Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- db.leads.aggregate([
- {$project:{
- _id:0,
- status:1,
- stage:1,
- "todo.title":1,
- created:{
- day:{$substr:["$createdOn",8,2]},
- month:{$substr:["$createdOn",5,2]},
- year:{$substr:["$createdOn",0,4]}
- },
- myDate:{$concat:["$created.day","-","$created.month","-","$created.day"]}
- //----above $concat is not working-----//
- }
- }
- ])
- {
- "stage" : "Prospect",
- "todo" : [],
- "status" : "OPEN",
- "created" : {
- "day" : "12",
- "month" : "09",
- "year" : "2016"
- },
- "myDate" : null
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement