Restore data Mongodb from JSON

前端 未结 2 716
無奈伤痛
無奈伤痛 2021-01-04 10:28

I have a dump which including 2 files data.json and metadata.json. I need restore this data on my local pc, I tried used mongorestore

相关标签:
2条回答
  • 2021-01-04 10:49

    The mongorestore program writes data from a binary database dump created by mongodump to a MongoDB instance. While, mongoimport tool provides a route to import content from a JSON, CSV, or TSV export created by mongoexport, or potentially, another third-party export tool.

    You have .json files. So, you can try mongoimport:

    mongoimport --db <database_name> --collection <collection_name> <path to data.json>/data.json
    
    0 讨论(0)
  • 2021-01-04 11:05

    Please check following link i think this will help you to restore your db using terminal

    MongoRestore

    0 讨论(0)
提交回复
热议问题