Created
September 16, 2021 06:37
-
-
Save caprica/15af430ee1216e7c86a58a3f83d8dc04 to your computer and use it in GitHub Desktop.
Simple MongoDB regex
This file contains hidden or 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
// Sequence number begins zero | |
db.collectionName.find({ | |
"sequenceNumber": { $regex: /^0/ } | |
}) | |
// Sequence number ends zero | |
db.collectionName.find({ | |
"sequenceNumber": { $regex: /0$/ } | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment