Date gte lte error

7 views
Skip to first unread message

anand catty

unread,
Sep 23, 2016, 12:52:30 PM9/23/16
to Mongoose Node.JS ODM
Hi,
Following query is working perfectly in Robomongo--mongo client
db.getCollection('news').find({"datePosted": {"$gte": new Date('2016-03-21'), "$lte": new Date('2016-09-21')}})

. But not working when I use the same in mongoose nodejs.like below..It neither throws error..Just returning empty news object

News.find({"datePosted": {"$gte": new Date('2016-03-21'), "$lte": new Date('2016-09-21')}}).exec(function (err, news) {

}

Please help,
Thanks
Anand
Reply all
Reply to author
Forward
0 new messages