Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- db.getCollection('people').find({
- date: {
- $gte: ISODate("2017-04-24T14:04:34.447Z")
- }
- },
- {
- _id: 0,
- age: 0,
- }
- );
- /* 1 */
- {
- "user_id" : "bcd020",
- "status" : "D",
- "date" : ISODate("2017-04-24T14:04:34.447Z")
- }
- /* 2 */
- {
- "user_id" : "bcd021",
- "status" : "D",
- "date" : ISODate("2017-04-24T14:04:34.447Z")
- }
- /* 1 */
- {
- "user_id" : "bcd020",
- "status" : "D",
- "date" : 2017-04-24 14:04:34
- }
- /* 2 */
- {
- "user_id" : "bcd021",
- "status" : "D",
- "date" : 2017-04-24 14:04:34
- }
- db.getCollection('people').aggregate([
- {
- $project:{
- datetime: {$dateToString: {format: "%G-%m-%d %H:%M:%S",date: "$datetime"}},
- age : 1
- }
- }
- ]);
Add Comment
Please, Sign In to add comment