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

Unable to createIndex on model. key must not contain '.'

      For example I have the vehicles collection with items as the example below:

      {
      "_id" : ObjectId("58d7f5a8e0661b63f05f690c"),
      "imei" : "000000000000001",
      "customerId" : ObjectId("58d7f48be0661b63f05f4a25"),
      "gsmNo" : "0000000002",
      "licensePlate" : "X-8830-34",
      "audit" :
      { "updatedAt" : ISODate("2011-05-22T08:20:02.000Z"), "deletedAt" : ISODate("2010-08-26T08:31:59.000Z") },
      "accessControl" :
      { "get" : [ ObjectId("58d7f47ee0661b63f05f0836"), ObjectId("58d7f47ee0661b63f05f0837") ], "patch" : [ ObjectId("58d7f480e0661b63f05f0867"), ObjectId("58d7f47ee0661b63f05f07c3") ], "put" : [ ObjectId("58d7f47ee0661b63f05f07c3"), ObjectId("58d7f47ee0661b63f05f07c5") ], "update" : [ ObjectId("58d7f47ee0661b63f05f07c3"), ObjectId("58d7f47ee0661b63f05f07c5"), ObjectId("58d7f47ee0661b63f05f07ca"), ObjectId("58d7f47ee0661b63f05f07cb"), ObjectId("58d7f47ee0661b63f05f07cc") ], "delete" : [ ObjectId("58d7f47ee0661b63f05f07c3"), ObjectId("58d7f47ee0661b63f05f07c5") ] }
      }

      Trying to create an index via

      db.collection.createIndex({'accessControl.get': 1}, {background: true}, cb);

      results in error:

      key accessControl.get must not contain '.'

            Assignee:
            christkv Christian Amor Kvalheim
            Reporter:
            baris@triomobil.com Celal Baris Ozdemir
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: