Uploaded image for project: 'Node.js Driver'
  1. Node.js Driver
  2. NODE-2922

createIndexes returns only index name instead of document

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Blocker - P1
    • Resolution: Duplicate
    • Affects Version/s: 4.0.0
    • Fix Version/s: None
    • Component/s: Shell
    • Labels:
      None

      Description

      collection.createIndexes returns the wrong value in v4.0.0, instead of returning the index spec from the server it only returns the index name as a string.  I'm filing this as a bug because the createIndexes function signature says it should return a document

      With 3.6.3 on a standalone 4.2

       

      > await c.db('test').collection('coll').createIndexes([ { name: 'index-1', key: { x: 1 } } ])
      {
        createdCollectionAutomatically: false,
        numIndexesBefore: 1,
        numIndexesAfter: 2,
        ok: 1
      }
      >

       

      With 4.0.0 on standalone 4.2

      > await c.db('test').collection('coll').createIndexes([ { name: 'index-1', key: { x: 1 } } ])
      'index-1'
      

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              eric.adum Eric Adum (Inactive)
              Reporter:
              anna.herlihy Anna Herlihy (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: