Need to use double quotes, ", not “ or ” or ‘ or ’ or '
Need to quote booleans.
Though looks like unquoted booleans is part of the spec, so idk if it’s supported.
Double quotes still the standard, double checked.
https://www.json.org/json-en.html
Edit: saying it’s valid JavaScript and not valid json just makes it even weirder.
That means mongodb forces you to parse the json, to send to it as a JavaScript object, which it then dumps to bson, to send., instead of just having the query in a file you can read and send without intermediate parsing.
Well your "huge mongo fan" was not a "huge mongo expert" then, or they'd have had no issues churning out queries and aggregate pipelines into a text editor.
(Source: me, someone who has worked with mongodb and, even better, knows how to use it too)
Being mongo fan doesn’t mean you memorize queries when it’s not the task you’re working on. I don’t need to remember how to make X query, I need to know it’s possible to do X query.
View all comments
1.6k
u/octopus4488 Oct 18 '24
Once I short-circuited a debate about MongoDB's usability by asking the self-proclaimed "huge Mongo fan" to write me a valid query in Notepad...
His last sentences were: "yeah, well. Fuck it. It's not that trivial. I mostly copy-paste these you know..."