Query the string type Date in mongodb

前端 未结 3 742
醉梦人生
醉梦人生 2021-01-14 05:07

This is my query in mongodb

db.order.find ({\"ublExtensions.ublExtensions.extensionContent.Metadata
                .ModificationTime\": \"2012-02-04T01:58:2         


        
3条回答
  •  Happy的楠姐
    2021-01-14 05:37

    Why can't you just use $gt query and for comparing time you can use Date.now() and from that Date.now() you can use previous date, like if current date is "2017-05-16T02:08:48.419+05:30" then you will write the query

    db.collection.find({"createdAt": { $gte : new ISODate("2017-05-15T02:08:48.419+05:30") }})
    

提交回复
热议问题