5

More specifically , can i use some bridge for this like first i should copy data to excel fro mongodb and then that excel sheets data could easily be imported into mysql by some scripts like as in Python.

3
  • docs.mongodb.org/manual/reference/program/mongoexport/…, stackoverflow.com/questions/3635166/… - Does this help? Commented Nov 25, 2014 at 5:35
  • my question is importing data from mongodb to mysql . Can i get some stuff regarding this. Commented Nov 25, 2014 at 5:41
  • You can write a Python (or choose your favourite language) script that talks directly to both databases, or you could use command-line tools like mongoexport and mysqlimport. Generally you'd want to consider different (and more appropriate) data models rather than just a straight copy between relational & non-relational databases. Going by way of Excel is completely unnecessary. Commented Nov 25, 2014 at 5:42

1 Answer 1

4

MongoDB does not offer any direct tool to do this, but you have many options to achieve this.

You can:

  • Write your own tool using your favorite language, that connect to MongoDB & MySQL and copy the data
  • Use mongoexport to create files and mysqlimport to reimport them into MySQL
  • Use an ETL (Extract, Transform, Load) that connect to MongoDB, allow you to transform the data and push them into MySQL. You can for example use Talend that has connector for MongoDB, bu you have many other solutions.

Note: Keep in mind that a simple document could contains complex structures such as Array/List, sub-documents, and even an Array of sub-documents. These structures can not be imported directly into a single table record, this is why most of the time you need a small transformation/mapping layer.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.