convert Mongo JSON

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

convert Mongo JSON

Roshan
Hi Erman,

is there a way I can convert a Mongo JSON collection to SQL?

I have one mongo collection which is quite complex (arrays ...)

MongoSQL.PNG

Kindly advise.

Roshan
Reply | Threaded
Open this post in threaded view
|

Re: convert Mongo JSON

ErmanArslansOracleBlog
Administrator
I never used this kind of a tool, but there are some tools for migrating data from mongodb to rdbms databases.

I made a quick search and found this one -> SQLizer.

But I never used it before.

Check these ->

https://blog.sqlizer.io/posts/mongodb-sqlizer-api/
https://sqlizer.io/?utm_source=mongodb#/

They say -> Upload your Excel file, choose the worksheet with the data, select the cell range, and hit convert. We'll convert your file into a MySQL script with a table definition and multiple INSERT statement..

So these insert statements are actually what you are looking for but uploading data to a website? Hmm that's a little weird.

You can write your own script to create those inserts for you!.
So, write a program that reads the records from MongoDB and transforms them into the equivalent then create insert statement according to your target rdbms..

So if you are asking for Oracle;

For data tansfer, you may follow an approach like this as well->

Use mongoexport nd export to a csv. Then use tools like SQLLoader or write a PL/SQL block to import that data to Oracle.