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

Find operations fail when passed an ObjectId as a filter

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Unknown Unknown
    • 5.2.0
    • Affects Version/s: None
    • Component/s: CRUD
    • 2
    • 2
    • Not Needed
    • Not Needed
    • Hide

      1. What would you like to communicate to the user about this feature?
      2. Would you like the user to see examples of the syntax and/or executable code and its output?
      3. Which versions of the driver/connector does this apply to?

      Show
      1. What would you like to communicate to the user about this feature? 2. Would you like the user to see examples of the syntax and/or executable code and its output? 3. Which versions of the driver/connector does this apply to?

      JoCat has created PR #3604: fix: passing of ObjectId as a filter in node-mongodb-native

      AC

      Implementation

      • correct the _bsontype check against 'ObjectID' to be 'ObjectId' to correctly identify ObjectId instances.

      Testing

      • Ensure all find APIs that use the FindOperation class support the syntax of passing an ObjectId directly as a filter
      • Ensure the filter always maps _id to the provided ObjectId instance

      Follow Up

      • File a ticket in the v6 epic about the future support of this functionality, include
        • Typescript definition considerations
        • API Documentation, deprecation or otherwise communication
        • Unsupported similar functionality, ex. lack of support in findAnd* methods

            Assignee:
            neal.beeken@mongodb.com Neal Beeken
            Reporter:
            dbeng-pm-bot PM Bot
            Warren James
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: