Convert String to Date by using map function in MongoDb

Convert String to Date  by using map function in MongoDb



db.getCollection('trackings').find({"created_date": /^Fri Dec 11 2015.*/})
      .map(
        function(tracking) {
          db.getCollection('trackings').update({ "_id": tracking._id}, 
          {
            $set: {
                "created_date": new Date(tracking.created_date)
            }
          }, 
          {
            multi: false
          }
      );
     return [tracking.created_date]
    }
   );

Comments

  1. With no reside casino, this web site may not be not|will not be} 온라인 카지노 the best choice|the only option|your greatest option} for UK gamers preferring sites with reside casino video games. The present welcome bonus at this UK on-line casino provides new gamers a first deposit bonus of fifty bonus spins. First deposits must meet the €10 minimum, but PlayOJO doesn’t require minimum wagering for welcome bonuses.

    ReplyDelete

Post a Comment

Popular posts from this blog

Design a notification system

NETFLIX HIGH-LEVEL SYSTEM DESIGN

URL Shortener System Design