2 ms·
They're both nice. Because the data modelling paradigms are so different, I don't see much point in trying to shoehorn SQL into MongoDB. Consider the case whe
by _pius 17y ago
They're both nice. Because the data modelling paradigms are so different, I don't see much point in trying to shoehorn SQL into MongoDB.
Consider the case where you're modelling blog posts with zero or more tags. In a relational database you'd typically have a posts table, a tags table, and a posts_tags join table. In MongoDB you'd have a posts collection with an indexed array key for the tags.
Searching for all the posts with the tag foo is just: db.posts.find({tags: 'foo'}).
Looks pretty nice to me. Why would I want to use a relational query language for a document-oriented database?