0
database.collection("twmsg").find(
        {"user":
            {"created_at": 
                {   
                        $gte: new Date("Fri Jul 03 08:15:31 +0000 2014")  
                }
           }
    }).toArray(function(err,dt){ console.log(dt);res.json(dt)})}

So this is what I am trying to find anything greater or equal in specific date. But date format is saved as "Fri Jul 03 08:15:31 +0000 2014" in MongoDB. I am actually trying to search this date format "Fri Jul 03 08:15:31 +0000 2014" by using date picker which only has month-date-year.

이재찬
  • 56
  • 7

1 Answers1

0

I'd look at this answer here first, the accepted answer should help as it uses the date object with mongo: Date query with ISODate in mongodb doesn't seem to work

For some resources online: http://mongodb.github.io/node-mongodb-native/2.2/api/Collection.html#find

https://mongodb.github.io/node-mongodb-native/markdown-docs/queries.html

BenD
  • 118
  • 1
  • 10