Struggling to execute the command in the terminal

Hello,

I am struggling to execute the command to create the user in the terminal. As per me, the following command is correct

db.createUser(  {  user: "m103-application-user",    pwd: "m103-application-pass",    roles: [ { db: "applicationData", role: "readWrite" } ]  })

But it is giving me an error in bash, stating syntax error near unexpected token `{’. Please advise.

Ignore…Was able to fix.

Hi @Naresh_Chandra_Padhy, welcome to the community.
Can you please share the steps you performed to fix this issue with the Community? It would be really helpful for people who might face a similar issue in the future.

If you have any doubts, please feel free to reach out to us.

Thanks and Regards.
Sourabh Bagrecha,
MongoDB

I was trying to launch another instance of MongoD. I skipped the instruction where it said I have to connect to an already running mongod instance.

1 Like