converting database from mysql to mongoDb

后端 未结 13 1269
陌清茗
陌清茗 2020-12-07 10:43

is there any easy way to change the database from mysql to mongoDB ?

or better any one suggest me good tutorial do it

13条回答
  •  有刺的猬
    2020-12-07 11:02

    is there any easy way to change the database from mysql to mongoDB ?

    Method #1: export from MySQL in a CSV format and then use the mongoimport tool. However, this does not always work well in terms of handling dates of binary data.

    Method #2: script the transfer in your language of choice. Basically you write a program that reads everything from MySQL one element at a time and then inserts it into MongoDB.

    Method #2 is better than #1, but it is still not adequate.

    MongoDB uses collections instead of tables. MongoDB does not support joins. In every database I've seen, this means that your data structure in MongoDB is different from the structure in MySQL.

    Because of this, there is no "universal tool" for porting SQL to MongoDB. Your data will need to be transformed before it reaches MongoDB.

提交回复
热议问题