Error getting the collection indexes from mongo 3.0.6

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Done
    • Priority: Minor - P4
    • None
    • Affects Version/s: 2.0.27, 2.0.46
    • Component/s: MongoDB 3.2
    • Environment:
      Red Hat Enterprise Linux Server release 6.5 (Santiago)
      node v0.10.33
      MongoDB 3.0.6
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      Our nodejs server gets all the indexes from a collection with:

      db.collection(collectionName).indexes(function onIndexes(err, mongoIndexes)

      { ... }

      This code works correctly with mongo 2.4 and 2.6, but it does not work with mongo 3.0.6. The callback returns an error:

      {"name":"MongoError","message":"no database","ok":0,"errmsg":"no database","code":26}

      I receive the same error with "listIndexes.toArray(...)". However, other operations on the collection work successfully (there is a valid connection to mongo).

      We use mongo driver "mongodb": "2.0.27", but I've just tested with the latest version as well: "mongodb": "2.0.46" getting the same results.

      NOTE: Although I've selected mongodb 3.2 as component, we actually are using mongodb 3.0.6 because that's an external requirement.

        1. package.json
          0.2 kB
          Jorge Lorenzo
        2. test.js
          0.4 kB
          Jorge Lorenzo

              Assignee:
              Christian Amor Kvalheim
              Reporter:
              Jorge Lorenzo
              None
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: