3 ms·
SQL is really nice for querying sets. There's no reason Mongo has to go without its query capabilities, really.
by mrkurt 17y ago
SQL is really nice for querying sets. There's no reason Mongo has to go without its query capabilities, really.
- _pius 17y agoThey'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?