Find objects between two dates MongoDB

后端 未结 14 2077
余生分开走
余生分开走 2020-11-21 06:03

I\'ve been playing around storing tweets inside mongodb, each object looks like this:

{
\"_id\" : ObjectId(\"4c02c58de500fe1be1000005\"),
\"contributors\" :          


        
14条回答
  •  遇见更好的自我
    2020-11-21 06:09

    You can also check this out. If you are using this method, then use the parse function to get values from Mongo Database:

    db.getCollection('user').find({
        createdOn: {
            $gt: ISODate("2020-01-01T00:00:00.000Z"),
            $lt: ISODate("2020-03-01T00:00:00.000Z")
        }
    })
    

提交回复
热议问题