this is the Structure of the collection
{
"userid": "c7ff591eda700a6d159fe74677f02c98",
"__v": 0,
"created": "2017-02-02T09:35:55.372Z",
"schedules": [
{
"description": "demo event",
"scheduled": "2/1/17 3:05 PM"
},
{
"scheduled": "1/25/17 3:06 PM",
"description": "demo event 2"
},
{
"scheduled": "2/4/17 3:06 PM",
"description": "demo event 3"
},
{
"scheduled": "2/1/17 3:10 PM",
"description": "demo"
},
{
"scheduled": "2/9/17 3:10 PM",
"description": "demo2"
},
{
"scheduled": "2/1/17 3:23 PM",
"description": "das"
},
{
"scheduled": "2/3/16 3:30 PM",
"description": "call ted"
},
{
"scheduled": "2/3/16 3:30 PM",
"description": "call ted"
},
{
"scheduled": "2/3/16 3:30 PM",
"description": "call ted"
}
]
}
I just want to get the data which are scheduled after current date and time.
i have also tried
db.<collection name>.find({"userid":c7ff591eda700a6d159fe74677f02c98},
{schedules:{$elemMatch:{scheduled:{$gte:'2/1/17 4:00 PM'}}}});
this statement return's only return scheduled just after that 1 feb that is "demo event3".
db.<collection name>.find({"userid":c7ff591eda700a6d159fe74677f02c98,
'schedules.scheduled':{$gte:'2/1/17 4:00 PM'});
this query return's whole collection. some one please help me..