r/ProgrammerHumor • • Oct 18 '24

Other mongoDbWasAMistake

Post image
13k Upvotes

446 comments sorted by

View all comments

Show parent comment

14

u/theturtlemafiamusic Oct 18 '24

Single quotes will work fine in pretty much any MongoDB client. Also you don't need the quotes around "skeptical" at all.

And JSON and MongoDB JSON are not exactly the same.

This is valid MongoDB JSON for example

{ name: { $regex: /acme.*corp/i, $nin: [ 'acmeblahcorp' ] } }

https://www.mongodb.com/docs/manual/reference/operator/query/regex/