- 
    Type:Bug 
- 
    Resolution: Duplicate
- 
    Priority:Minor - P4 
- 
    None
- 
    Affects Version/s: None
- 
    Component/s: mongorestore
- 
    Environment:Ubuntu 20.04
Problem Description
mongorestore will not use the database specified in the URI when restoring from files. Instead, you will need to manually specify the target database name with "--db" to have the restore working correctly.
Steps to Reproduce
Move inside a folder with BSON files to be restored to a database DB_NAME to be created and run the following command (assuming the URI is valid):
mongorestore --uri "mongodb+srv://${MONGO_USER}:${MONGO_PASS}@${MONGO_HOST}/${DB_NAME}" .
Expected Results
Restore operation should perform normally as if the following command was run:
mongorestore --uri "mongodb+srv://${MONGO_USER}:${MONGO_PASS}@${MONGO_HOST}" --db ${DB_NAME} .
Actual Results
Restore operation fails with messages:
don't know what to do with file "FILE.bson", skipping...