In Mongo version 2.2 the addUser function used to assert the username and password, modifying the existing user's password if it exists or creating a new entry if not. This appears to have been stripped from the system in 2.4 when using roles, such that running the current addUser function produces this error instead:
Tue May 14 15:19:58.257 JavaScript execution failed: User already exists with that username/userSource combination at src/mongo/shell/db.js:L125
Using the legacy addUser function to perform the task does not work either, because it attempts to assert the readOnly field as well:
Tue May 14 15:20:17.754 JavaScript execution failed: couldn't add user: system.users entry must not have both 'roles' and 'readOnly' fields at src/mongo/shell/db.js:L128
Attempting to set the field directly results in an un-hashed password in the document where a hashed password should be.
I couldn't find any information on changing passwords in the documentation for addUser or the user privilege documents. Are the only options to change a user password in 2.4 to either delete the user from the database and then recreate it, or to hash the password manually?
--
--
You received this message because you are subscribed to the Google
Groups "mongodb-user" group.
To post to this group, send email to mongod...@googlegroups.com
To unsubscribe from this group, send email to
mongodb-user...@googlegroups.com
See also the IRC channel -- freenode.net#mongodb
---
You received this message because you are subscribed to the Google Groups "mongodb-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mongodb-user...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.