Advertisement
Guest User

Untitled

a guest
Sep 27th, 2016
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.57 KB | None | 0 0
  1. db.leads.aggregate([
  2. {$project:{
  3. _id:0,
  4. status:1,
  5. stage:1,
  6. "todo.title":1,
  7. created:{
  8. day:{$substr:["$createdOn",8,2]},
  9. month:{$substr:["$createdOn",5,2]},
  10. year:{$substr:["$createdOn",0,4]}
  11. },
  12. myDate:{$concat:["$created.day","-","$created.month","-","$created.day"]}
  13. //----above $concat is not working-----//
  14. }
  15. }
  16.  
  17. ])
  18.  
  19. {
  20. "stage" : "Prospect",
  21. "todo" : [],
  22. "status" : "OPEN",
  23. "created" : {
  24. "day" : "12",
  25. "month" : "09",
  26. "year" : "2016"
  27. },
  28. "myDate" : null
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement