3 ms·
I just took a look, and if I'm getting this right, it looks about as simple as it gets: SELECT json_data FROM people WHERE json_data->'age' > 15 vs db.people
by tensor 13y ago
I just took a look, and if I'm getting this right, it looks about as simple as it gets:
SELECT json_data FROM people WHERE json_data->'age' > 15
vs
db.people.find( { age: { $gt: 10 } } )
Personally, I prefer the postgres syntax. It's much clearer. I also don't buy your claims below about performance. Can you provide a real benchmark? Are you running with the safeties off meaning you lose data?
- dbcfd 13y agoWhat is the syntax on finding an array value matching some key? E.g. given a user with field "favFoods":[String], how do I determine that pizza is in there?
- jessedhillon 13y agoselect ... where "pizza" in person -> favFoods
- jessedhillon 13y agoSorry I'm stupid, I was thinking Python select ... where person -> favFood in ("pizza")