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

Type issue with findOneAndUpdate and aggregation pipelines

    • 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?

      Description

      The findOneAndUpdate method supports aggregation pipelines in the update argument. However, the documentation and types do not indicate this functionality.

      User Experience

      Acceptance Criteria

      Implementation Requirements

      • Add API comments explaining that, for findOneAndUpdate:
        • `UpdateFilter<TSchema>` covers a document that contains update operator expressions
        • `Document[]` covers aggregation pipelines in the update filter
      • The types for findOneAndUpdate should be updated to explicitly include a Document[] type for the update parameter

      Testing Requirements

      • Integration tests verifying that aggregation pipelines work with findOneAndUpdate
      • Type tests verifying that aggregation pipelines work with findOneAndUpdate

      Documentation Requirements

      • See Above

      Follow Up Requirements

      • N/A

            Assignee:
            bailey.pearson@mongodb.com Bailey Pearson
            Reporter:
            emily.klassen@tenthousandcoffees.com Emily Klassen
            Bailey Pearson
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: