2

this is my first question here because i really don't know what to do.

So i got a Database named mydatabase. I also got a Collection named mycollection. And i got a Backup-File named backup.bson.gz.

I want to use a command in MongoDB / Robo 3T that restores the backup file onto the database.

Because of that i tried the mongorestore command but i get the error:

Error: Line 1: Unexpected identifier

I wrote the command as shown in the title.

Thank you in advance!

Shelly
  • 23
  • 3

1 Answers1

1

use flag --drop

mongorestore -d mydatabase -c mycollections C:\Users\backup.bson.gz --drop
mohammad Naimi
  • 2,259
  • 1
  • 5
  • 15