Query mongodb to return documents created today - Stack Overflow

PHOTO EMBED

Sun May 23 2021 12:02:05 GMT+0000 (UTC)

Saved by @ali_alaraby #javascript

db.doc.find({_id : { $gt : ObjectId(Math.floor(new Date(new Date().getFullYear()+'/'+(new Date().getMonth()+1)+'/'+new Date().getDate())/1000).toString(16)+"0000000000000000") }})
content_copyCOPY

https://stackoverflow.com/questions/21464886/query-mongodb-to-return-documents-created-today