Uploaded image for project: 'Documentation'
  1. Documentation
  2. DOCS-2705

Update the mongo shell db.auth command to state the return values

    XMLWordPrintableJSON

Details

    • Icon: Task Task
    • Resolution: Done
    • Icon: Minor - P4 Minor - P4
    • v1.3.1
    • None
    • manual
    • None

    Description

      The current db.auth page doesn't indicate that the function returns 0 if the command fails. Nor does it state that this function will never throw an exception.

      We should update this page to explicitly state that the command catches any exception and return 0 to indicate that it has failed.

      db.auth
      function () {
          var ex;
          try {
              this._authOrThrow.apply(this, arguments);
          } catch (ex) {
              print(ex);
              return 0;
          }
          return 1;
      }

      Attachments

        Activity

          People

            sam.kleinman Sam Kleinman (Inactive)
            jim.oleary@mongodb.com James O'Leary
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:
              9 years, 50 weeks, 5 days ago