Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

sql query to mongodb?

Tags:

sql

mongodb

After seeing this image: http://2.bp.blogspot.com/_T-uXeKcGTnM/TIdoKBGwk9I/AAAAAAAABcs/CLW3_cRlN78/s1600/tumblr_kxovt0VLZy1qappj8.png I wonder is exists any tool for translating SQL querys into MongoDB map/reduce query model??

Larger version of the image: http://rickosborne.org/download/SQL-to-MongoDB.pdf

like image 663
Jorge González Lorenzo Avatar asked Jan 06 '11 14:01

Jorge González Lorenzo


People also ask

Can I use SQL to query MongoDB?

Through the coherent structure of tables and the sophisticated transformation that Data Virtuality performs automatically, MongoDB can easily be accessed and queried with just regular SQL statements, and the content can be combined with other data sources, such as relational databases.

Can we use SQL and MongoDB together?

Now that SQL Server can understand and shred JSON data, SQL Server and MongoDB can easily cohabit and pass data between them.


2 Answers

Update to the question asked in Jan 2011:

A couple of sites exist now to convert sql to mongodb.

Convert MySQL Queries to MongoDB Syntax http://www.querymongo.com/

And

Convert sql to mongodb http://klaus.dk/sqltomongodb/

like image 151
Craig Nicholson Avatar answered Oct 09 '22 02:10

Craig Nicholson


The simple anwser? No.

The slightly more complex anwser is some people have had luck translating more complex SQL to Mapreduce functions ...

http://rickosborne.org/blog/index.php/2010/02/08/playing-around-with-mongodb-and-mapreduce-functions/

http://rickosborne.org/blog/index.php/2010/02/19/yes-virginia-thats-automated-sql-to-mongodb-mapreduce/

However, that said ... generally speaking you might as well learn mapreduce properly because if the data is in MongoDB already ... you'll really need to know how to properly query MongoDB to get anything meaningful done!

MongoDB has wonderful and helpful docs http://www.mongodb.org/display/DOCS/Advanced+Queries

As well as an easy to use online tutorial: http://try.mongodb.org/

like image 23
Justin Jenkins Avatar answered Oct 09 '22 02:10

Justin Jenkins