Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-11365

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

    XMLWordPrintableJSON

Details

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major - P3 Major - P3
    • 2.5.4
    • 2.5.3
    • None
    • None
    • ALL

    Description

      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" ] }

      Attachments

        Activity

          People

            spencer@mongodb.com Spencer Brody (Inactive)
            matt.dannenberg Matt Dannenberg
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: