mongorestore command replace existing records?

前端 未结 4 1954
孤城傲影
孤城傲影 2021-01-01 10:29

Is there a way for mongorestore to replace the records existing in the database instead of skipping it which is the default behavior ?

I\'m currently using the lates

4条回答
  •  执笔经年
    2021-01-01 10:42

    You could use the --drop parameter of mongorestore:

    Before restoring the collections from the dumped backup, drops the collections from the target database. --drop does not drop collections that are not in the backup.

提交回复
热议问题