I am using nodeJs + Mongodb. I want to date filter(from_date to to_date) with sub array.
Schema:
var model = new Schema({
clientID: Object,
recordEntryList: [{
visitedDate: Date
}]
});
Sample record Data:
{
"_id" : ObjectId("58eb333e3a9ce4120c0cb232"),
"clientID" : "5864a82959056f1730dbf969",
"recordEntryList" : [
{
"visitedDate" : ISODate("2017-04-10T12:54:46.660+05:30"),
"_id" : ObjectId("58eb333e3a9ce4120c0cb233")
},
{
"visitedDate" : ISODate("2017-04-10T12:55:01.684+05:30"),
"_id" : ObjectId("58eb334d3a9ce4120c0cb235")
},
{
"visitedDate" : ISODate("2017-04-10T14:09:43.331+05:30"),
"_id" : ObjectId("58eb44cf16bc0c0d34219ad3")
}
],
"__v" : 0
}
When i filter with date, i want only that records whose "visitedDate" is valid for filter. This filter also apply for sub array("recordEntryList").
via Hardik Mandankaa
No comments:
Post a Comment