-
Type:
Bug
-
Resolution: Unresolved
-
Priority:
Minor - P4
-
None
-
Affects Version/s: None
-
Component/s: CRUD
Use Case
As a... developer
I want... to specify `options` optionally (e.g. to supply `session`)
So that...i can execute commands under a transaction
User Experience
- What is the desired/expected outcome for the user once this ticket is implemented?
be able to specify an undefined `option` to the distinct() command
- If bug: What is the number of impacted customers? How severe is the impact? Is anyone blocked or broken?
anyone that wants to call distinct() with transaction
Dependencies
- n/a
Risks/Unknowns
- What could go wrong while implementing this change? (e.g., performance, inadvertent behavioral changes in adjacent functionality, existing tech debt, etc)
- Is there an opportunity for better cross-driver alignment or testing in this area?
add testing to all collection commands to ensure `options` is optional
- Is there an opportunity to improve existing documentation on this subject?
Acceptance Criteria
Implementation Requirements
in collection.ts
https://github.com/mongodb/node-mongodb-native/blob/main/src/collection.ts
add a `?` to the options arg, i.e.
// question mark on options
distinct(key: string, filter: Filter<TSchema>, options?: DistinctOptions): Promise<any[]>;
instead of (current):
// no question mark on options
distinct(key: string, filter: Filter<TSchema>, options: DistinctOptions): Promise<any[]>;
Testing Requirements
- unit test
Documentation Requirements
- ?
Follow Up Requirements
- additional tickets to file, required releases, etc
- if node behavior differs/will differ from other drivers, confirm with dbx devs what standard to aim for and what plan, if any, exists to reconcile the diverging behavior moving forward