Mongo single table recovery

I want to restore a single table, the command written like this

mongorestore --username admin --password "pwdmongo" --db poi --collection newPoi newPoi.bson

but keep prompting errors

connected to: 127.0.0.1
assertion: 18 { ok: 0.0, errmsg: "auth failed", code: 18, codeName: "AuthenticationFailed" }

Mar.20,2021

first of all, the problem must be that after confirming the user's password in the authentication process, try to remove the double quotes and try again


try to add -- authenticationDatabase admin

mongorestore --username admin --password "pwdmongo" --db poi --collection newPoi newPoi.bson --authenticationDatabase admin

users should authenticate on the library on which they are created.

Menu