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

createIndexes returns only index name instead of document

    • Type: Icon: Bug Bug
    • Resolution: Duplicate
    • Priority: Icon: Blocker - P1 Blocker - P1
    • None
    • Affects Version/s: 4.0.0
    • Component/s: Shell
    • None

      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'
      

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

              Created:
              Updated:
              Resolved: