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

node driver api createIndex() can't capture specific error

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 3.1.9
    • Affects Version/s: 3.1.4
    • Component/s: Native
    • Environment:
      operating system: ubuntu 16.04
      mongo server: 3.2.19

      When I execute a command to create index in mongo shell , it return err as below:
      case 1:

      db.qrcode.createIndex(\{"accountId":1,"name":1}, \{"backgroud": true})
      {
      "ok" : 0,
      "errmsg" : "WiredTigerIndex::insert: key too large to index, failing  1470 \{ : \"56f37cb8e4b089e98d52ab0e\", : \"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa...\" }",
      "code" : 17280
      }
      

       

      case 2:

      db.tag.createIndex({"tags.value":1,"isDeleted":1,"crowds.text":1}, { background: true }); { "ok" : 0, "errmsg" : "cannot index parallel arrays [crowds] [tags]", "code" : 10088 }
      

       
      But  when I use mongodb driver in my nodejs code to invoke createIndex() method to create the indexes, it both return index name and did't throw any error !
       
      I executed getIndexes() command  in mongo shell, In fact the indexes  were not inserted into mongo server.
       
      I just found the  above two kinds of error can't be captured, Othens are executed correctly.
       
      So I guess the error was not captured in mongodb driver.
       
       
       
       

            Assignee:
            daniel.aprahamian@mongodb.com Daniel Aprahamian (Inactive)
            Reporter:
            stanxing stanxing
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: