Last active
April 29, 2022 09:21
-
-
Save GalassoLuca/017ce2ea997a56576d5731674fbbbe26 to your computer and use it in GitHub Desktop.
query MongoDB documents based on creation date present in ObjectId
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const idFromDate = ObjectId.fromDate(ISODate("2021-02-08")) | |
db['collection'].count({ _id: { $gte: idFromDate } }) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment