Possible to compare date strings in mongodb?
问题 I have a collection that contains documents with a date attribute like so: { title: "whatever", created: ISODate("2013-05-27T03:36:50Z") } I would like to select records that were created on a certain day. I was hoping I could use toDateString() and compare the values but when I do a search like the one below: db.myCollection.find({ 'created.toDateString()': new Date('05/27/2013').toDateString() }).pretty() But this does not work. Is there any way to do what I am attempting above? 回答1: If you