Show HN: SQL to Mongo Query Translator
querymongo.com
querymongo.com
Depending on the type of query and the way you designed your database schema MongoDB queries can be either more concise or (in your words) more bloated than SQL. You can't really say either one is more bloated than the other in terms of query syntax.
Personally, I generally prefer MongoDB queries over SQL, because it doesn't have a concept of joins, inner queries, temporary tables, etc, which usually translates to more but simpler queries. If the data model for your applications relies heavily on any of these features, maybe you shouldn't use MongoDB (or any other NoSQL database, for that matter).
http://stackoverflow.com/questions/7303333/are-adhoc-queries...
Group does not function in Sharding mode at all, it also takes a lock on the JavaScript interpreter making it non-parallelizable.
Map/Reduce is somewhat better in that it is shardable, and with V8 likely in the next stable release, will have better parallelization prospects.
Ideally, you should be using the new Aggregation Framework to do this kind of work: http://docs.mongodb.org/manual/applications/aggregation/
(EDIT) To clarify - Aggregation is ideal because its implementation is 100% in C++, meaning there are no JavaScript interpreter locks necessary to run it, so it is parallelizable. Additionally, one of the biggest overhead costs to MapReduce and Group in MongoDB is the translation back and forth between BSON (the native format MongoDB uses for data, or rather the C++ representations thereof) and JavaScript types. Aggregation not utilizing JavaScript eliminates this overhead and manipulates the database' internal types directly.
Group still will not become sharding-capable with v8, either.
db.demo.aggregate([
{ $match: { score: { $gt: 0 },
person: { $in: ["bob","jake"] }}},
{ $group: { _id: "person",
sumscore: { $sum: "$score" },
avgscore: { $avg: "$score" },
minscore: { $min: "$score" },
maxscore: { $max: "$score" },
count: { $sum: 1 }}}
]);http://rickosborne.org/blog/2010/02/infographic-migrating-fr...
Failure parsing MySQL query: Unable to convert queries based on more than one table
This is specially useful because of the verbosity and ugliness of the "JSON" API (much more difficult to get right by hand than SQL) and because I found 0 working GUI tools to work with Mongo in a mac (they all crash at startup or after ~5 seconds of usage in a modern mac).
It's not very polished, but it gets the job done, and it makes it relatively easy to edit stuff that's already in the database.
SELECT * FROM demo WHERE score > 0 AND person LIKE '%bob%'
doesn't work that well. It will need to convert the %bob% thing to a regular expression.
HAVING SUM(abc) > 1
to the example.