Skip to content

Fix list all Indexes for a Database 3.6.1 #3168

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 3 commits into from

Conversation

FredericoSFerreira
Copy link

@FredericoSFerreira FredericoSFerreira commented Dec 13, 2017

This change is Reviewable

@kay-kim kay-kim force-pushed the v3.6.1 branch 2 times, most recently from 15d9e38 to f3175a4 Compare December 20, 2017 14:39
@p-mongo
Copy link

p-mongo commented Apr 1, 2020

The two syntaxes are equivalent in my testing:

MongoDB Enterprise ruby-driver-rs:PRIMARY> db['test'].getIndexes
function(filter) {
    var res = this.runCommand("listIndexes", filter);

    if (!res.ok) {
        if (res.code == ErrorCodes.NamespaceNotFound) {
            // For compatibility, return []
            return [];
        }

        throw _getErrorWithCode(res, "listIndexes failed: " + tojson(res));
    }

    return new DBCommandCursor(this._db, res).toArray();
}

@kay-kim
Copy link
Contributor

kay-kim commented Apr 1, 2020

Hi. Thanks for this pull request and apologies for the long delay.

As noted above, the mongo shell allows for db['collectionname']
MongoDB Enterprise > db['orders']
test.orders

MongoDB Enterprise > db.getCollection('orders')
test.orders

As such, will close this pull request without merge. However, we very much appreciate your taking the time to help us make the documentation better and once again, apologies for the long delay.

Regards,

Kay Kim

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants