-
Type: Bug
-
Resolution: Works as Designed
-
Priority: Major - P3
-
None
-
Affects Version/s: None
-
Component/s: mongorestore
-
None
I'm trying to restore an archive, and mongorestore keeps running into an error that it's "not allowed to do action [listCollections] on [mydb.]"
I don't want it to list collections. I've specified exactly what collection to restore:
$ mongorestore --uri=$MONGO_URL --archive=somefile.mongodump --gzip -d mydb -c mycol
2020-06-12T18:46:45.000-0700 the --db and --collection args should only be used when restoring from a BSON file. Other uses are deprecated and will not exist in the future; use --nsInclude instead
2020-06-12T18:46:45.047-0700 preparing collections to restore from
2020-06-12T18:46:45.104-0700 finished restoring mydb.mycol (0 documents, 0 failures)
2020-06-12T18:46:45.104-0700 Failed: mydb.mycol: error reading database: (AtlasError) user is not allowed to do action [listCollections] on [mydb.]
2020-06-12T18:46:45.104-0700 0 document(s) restored successfully. 0 document(s) failed to restore.
$ mongorestore --uri=$MONGO_URL --archive=somefile.mongodump --gzip --nsInclude mydb.mycol
2020-06-12T18:53:10.249-0700 preparing collections to restore from
2020-06-12T18:53:10.300-0700 finished restoring mydb.mycol (0 documents, 0 failures)
2020-06-12T18:53:10.300-0700 Failed: mydb.mycol: error reading database: (AtlasError) user is not allowed to do action [listCollections] on [mydb.]
2020-06-12T18:53:10.300-0700 0 document(s) restored successfully. 0 document(s) failed to restore.