[DOCS-2705] Update the mongo shell db.auth command to state the return values Created: 11/Feb/14  Updated: 28/Feb/14  Resolved: 28/Feb/14

Status: Closed
Project: Documentation
Component/s: manual
Affects Version/s: None
Fix Version/s: v1.3.1

Type: Task Priority: Minor - P4
Reporter: James O'Leary Assignee: Sam Kleinman (Inactive)
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Participants:
Days since reply: 9 years, 50 weeks, 5 days ago

 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;
}



 Comments   
Comment by Githook User [ 28/Feb/14 ]

Author:

{u'username': u'tychoish', u'name': u'Sam Kleinman', u'email': u'samk@10gen.com'}

Message: DOCS-2705: add return values to db.auth
Branch: master
https://github.com/mongodb/docs/commit/1bbb978f11ea28b7f30371db0e56f31cc4dc5148

Comment by Githook User [ 28/Feb/14 ]

Author:

{u'username': u'tychoish', u'name': u'Sam Kleinman', u'email': u'samk@10gen.com'}

Message: DOCS-2705: add return values to db.auth
Branch: v2.4
https://github.com/mongodb/docs/commit/af7481807d7e52b8871b48111fc147bc656d416b

Generated at Thu Feb 08 07:44:03 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.