-
Type: Bug
-
Resolution: Works as Designed
-
Priority: Unknown
-
None
-
Affects Version/s: bson-5.5.0
-
Component/s: None
Use Case
As a developer accepting a string OR object id as parameter
I want ensure to convert the string to an ObjectId, if its a valid one
So that I can pass the ObjectId to a mongodb query, or the plain string if its not a valid ObjectId
Example: ObjectId.isValid('Land/Namibia') returns TRUE - which seems wrong.
User Experience
- ObjectId.isValid is reliable
- If bug: What is the number of impacted customers? How severe is the impact? Is anyone blocked or broken?
Dependencies
- upstream and/or downstream requirements and timelines to bear in mind
Risks/Unknowns
- Previous use of ObjectId.isValid may break
Acceptance Criteria
Implementation Requirements
- ObjectId.isValid only returns true for valid object ids
Testing Requirements
- ObjectId.isValid('Land/Namibia') returns false
Documentation Requirements
- DOCSP ticket, API docs, etc
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