Wrong createIndex behavior

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Duplicate
    • Priority: Major - P3
    • 3.1.9
    • Affects Version/s: Not Applicable
    • Component/s: None
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      Unable to find source-code formatter for language: typescript. Available languages are: actionscript, ada, applescript, bash, c, c#, c++, cpp, css, erlang, go, groovy, haskell, html, java, javascript, js, json, lua, none, nyan, objc, perl, php, python, r, rainbow, ruby, scala, sh, sql, swift, visualbasic, xml, yaml
      import * as mongodb from 'mongodb'
      
      mongodb.connect('mongodb://localhost/test')
      .then(async (client) => {
        const db = await client.db('test')
        const collection = db.collection('ts')
        await collection.createIndex({a: 1}, {unique: true, partialFilterExpression: {$type: 'string'}})
      })
      

      createIndex did not throw an error with the wrong partialFilterExpression, instead of creating a collection named 'undefined' and insert a document with index options.

              Assignee:
              Daniel Aprahamian (Inactive)
              Reporter:
              weihang zhou
              None
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved: