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

Update hint throws an error starting at 3.3.4

    • Type: Icon: Bug Bug
    • Resolution: Gone away
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: 3.3.4, 3.4.0, 3.5.0, 3.5.1, 3.5.2
    • Component/s: None

      Update hint was improved in 3.3.4 according to this: 
      https://jira.mongodb.org/browse/NODE-2263

      Errors are thrown in versions >=3.3.4

      Works correctly in versions <3.3.4, not sure if hint is simply being ignored or there's a change to the implementation.

      code snippet to reproduce:

      await db.collection('events').updateOne(
         {
           "url": "https://mysite.com",
         },
         {
           "$inc": {
             "total": 1
           },
           "$setOnInsert": {
             "date": 1579651200000,
           }
         },
         {
           "upsert": true,
           "hint": {
             "url": 1,
           }
         }
       )

      Error thrown:

      MongoError: BSON field 'update.updates.hint' is an unknown field.
      errmsg: "BSON field 'update.updates.hint' is an unknown field.",
      code: 40415,
      codeName: 'Location40415',

            Assignee:
            eric.adum@mongodb.com Eric Adum (Inactive)
            Reporter:
            natan@provesrc.com Natan Abramov
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: