All this talk about query format and no one discussing the dogshit database design requiring the record to be updated whenever the user has a birthday? Store the day of birth and do the math at query time at least!
I do believe Mongo has some valid niche use cases, but far, far too many people think it's just a no-worries way to dump objects into a database without having to deal with all that fussy schema stuff. They only realize their mistake when it comes time to actually use that data as anything other than a huge, unmanageable blob of nested fields.
Granted, Mongo's marketing kind of encourages this.
Slightly off-topic: I get so confused with age conventions. I’m self-taught and do some ad-hoc work for the organization I work for (where no one else has any interest).
To get users between 25 and 30, wouldn’t you want strictly less than 30? And greater than or equal to 25? Or for age is it inclusive?
By the by, as someone who have used both NoSQL and SQL extensively (once in the same project), the trick of NoSQL is that you shouldn’t use FNF and compute that at write time. The idea is that it’s faster to MapReduce pre calculated values since that’s the operation you want to optimize in a NoSQL world. A lot of people get that wrong and just replace MySQL with Mongo without rethinking usage and schemas.
But even in a NoSQL context I’d rather use a Postgres jsonb column over MongoDB.
I guess you could argue that people we refer to as "25 years old" are actually 25 years and some days/hours/minutes/whatever old, therefore more than 25. People referred to as 30 are, in the same vein, more than 30
Well if you’re 25 and a day, that would mean you wouldn’t be able to fit any definition. The second after you turn 25 you would be “over 25” and could be included in 25, over 25 and between 25 and X until you turn 26 and the same repeats.
The OG comic was a guy talking to a baby, saying "Hey little guy, how's it going?" and the baby replies with gibberish. The third panel indicates a pause, and then the guy responds in the fourth panel with "yea" (which is supposed to be "yeah" and not the archaic affirmation that rhymes with "nay"). It's like he doesn't even know what he expected when he asked the question, and is just accepting the awkwardness and confusion.
The "Jesus Christ" variant seems to imply the stunning horror of whatever the guy sees in the second panel.
As a c# mssql developer I'm not familiar with json or mongodb but I don't get the meme. What's wrong with this syntax? It's readable and relatively concise. Is this a whoosh moment for me? What am I missing?
IMO it's just so clunky with what feels like way too many extraneous symbols. And that's just a very simple query, check out the equivalent of a join: https://stackoverflow.com/a/43653679
Granted, joining is not really what Mongo DB is for (that's the whole point of it being non-relational, after all). But even reaching deep into an object can get you into nesting hell very quickly.