using the old addUser syntax gives a warning followed by a success with confusing ux

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Done
    • Priority: Major - P3
    • 2.5.4
    • Affects Version/s: 2.5.3
    • Component/s: None
    • None
    • ALL
    • None
    • 3
    • None
    • None
    • None
    • None
    • None
    • None

      here was what I did/saw
      the first result message was confusing to me
      the latter half it is actually the successful user addition, I thought it was showing me the spec of a user object
      either better reporting or an error (and no op) in place of a warning should occur

      > db.addUser("foo", "bar")
      WARNING: This form of the addUser shell helper (that takes username, password, and readOnly boolean) is DEPRECATED. Use the form that takes a user object instead

      { "user" : "foo", "roles" : [ "dbOwner" ] }

      > db.addUser(

      {user:"foo", roles:["dbOwner"]}

      )
      2013-10-24T15:22:54.154-0400 Error: couldn't add user: Must provide a 'pwd' field for all user documents, except those with '$external' as the user's source db at src/mongo/shell/db.js:1005

      > db.addUser(

      {user:"hi", pwd:"asdf", roles:["dbOwner"]}

      )

      { "user" : "hi", "roles" : [ "dbOwner" ] }

            Assignee:
            Spencer Brody (Inactive)
            Reporter:
            Matt Dannenberg (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: