I can’t create a user in Mongo from Docker

Asked

Viewed 54 times

0

I’m executing the command:

mongo exec -it mongodb mongo --host localhost -u admin -p 3613 --authenticationDatabase admin --eval "db.getSiblingDB('testando').createUser({user: 'spirit', pw: '3613', roles: [{role: 'readWrite', db: 'testando'}]})"

But I get the mistake:

Error Parsing command line: unrecognised option '-it' Try 'C: Program Files Mongodb Server 4.2 bin Mongo.exe --help' for more information

1 answer

1


The command should be

docker exec -it ...

Browser other questions tagged

You are not signed in. Login or sign up in order to post.