I have just started learning, but I am not very good at it. I hope everyone can help me!
I use mongo-express, a graphical interface management tool, but when I log in, I am prompted to enter my account password. So I want to add an account password to my database.
I set up mongod at the beginning.
mongod –dbpath c:\data\db –logpath c:\data\logmongodb.log –logappend –serviceName zhp1 –auth –install
Then I did the following:
1. After executing the above statement, mongod is not started, and the following is also done without starting
2. I run mongo
3.use admin // enter the admin database.
I was always prompted in this fourth part.
2015-12-08T21:03:37.912 plus 0800eQuery Typeerror: Property’ AddUser’
of object admin is not a function at (shell):1:4
I would like to ask everyone to help me. Why is this?
Which version of mongodb is used? The function that created the user was changed to createUser earlier. This version of yours may have removed addUser. Check the syntax of createUser in the manual.