1
votes

I dump the mongodb database using mongodump --db dbName. Now when on different system I tried to restore it using mongorestore it is showing me error:

Failed: mindcentral.user: error creating collection mindcentral.user: error running create command: BSON field 'OperationSessionInfo.create' is a duplicate field

My dump folder is on desktop, so I am using command

mongorestore --db DBName Desktop/dump/DBName
1
This is hard to tell, without seeing an excerpt of the dump, esp. concerning OperationSessionInfo. Could you add that? Also, what are the versions of MongoDB on both systems? - mbuechmann

1 Answers

0
votes

You just Follow:
Mongorestore:

Syntax:

mongorestore -d databasename databasepath.

Example:

mongorestore -d user ./Desktop/dump/user

where the user is a database name.