[COMPASS-7088] Investigate changes in NODE-3568: Make findOneAnd family of methods spec compliant by default Created: 07/Aug/23  Updated: 29/Oct/23  Resolved: 29/Aug/23

Status: Closed
Project: Compass
Component/s: None
Affects Version/s: None
Fix Version/s: No version

Type: Investigation Priority: Major - P3
Reporter: PM Bot Assignee: Unassigned
Resolution: Fixed Votes: 0
Labels: node-driver
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
depends on NODE-3568 Make findOneAnd family of methods spe... Closed
Epic Link: MONGOSH-1319
Documentation Changes: Not Needed
Sprint: Iteration Iguanodon

 Description   

Use Case

As a driver engineer I want to reduce the difference between node and common driver's spec. Currently our findOneAnd* methods return a wrapped type for the findOneAnd* functions.

User Impact

  • This will be a breaking change that will make the ok and lastErrorObject properties inaccessible.
  • ok's value is implicit by the method not throwing
  • lastErrorObject should likely convert to an error as well so there's no need to provide a way to access it.

Dependencies

Unknowns

  • none

Acceptance Criteria

Implementation Requirements

  • Make the findOneAnd functions spec compliant by default: update `includeResultMetadata` to default to false
  • make sure findOne() also returns results consistent with the other methods (i.e., null instead of undefined for both flag settings)

Testing Requirements

  • modify spec test runner to no longer access the value property
  • update the default behavior tests
  • update any tangential tests that rely on the default behavior to access the value directly or to use the explicit flag setting

Documentation Requirements

  • Document change in the migration guide
  • DOCSP ticket to update any documented defaults and examples

Follow Up Requirements

  • Heads up to dev tools & mongoose

Generated at Wed Feb 07 22:45:19 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.