Uploaded image for project: 'Java Driver'
  1. Java Driver
  2. JAVA-1203

Java API should support db.createUser()

    • Type: Icon: New Feature New Feature
    • Resolution: Won't Fix
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: 2.12.1
    • Component/s: API, Authentication
    • Labels:
      None

      MongoDB 2.6.0 deprecates the db.addUser() and recommends the db.createUser() command.

      However, the Java API deprecates the db.addUser() method and suggests using the low-level db.command() method:

          /**
           * Adds or updates a user for this database
           *
           * @param username the user name
           * @param passwd   the password
           * @return the result of executing this operation
           * @throws MongoException
           * @mongodb.driver.manual administration/security-access-control/  Access Control
           * @deprecated Use {@code DB.command} to call either the addUser or updateUser command
           */
          @Deprecated
          public WriteResult addUser( String username , char[] passwd ){
              return addUser(username, passwd, false);
          }
      

      MongoDB Java Driver API should support db.createUser() as a replacement to db.addUser() (taking into account server version).

      Related to SERVER-3301.

            Assignee:
            Unassigned Unassigned
            Reporter:
            rudi Rudi Wijaya
            Votes:
            2 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: