-
Type: Bug
-
Resolution: Duplicate
-
Priority: Major - P3
-
Affects Version/s: 1.8.0
-
Component/s: Shell API
-
None
-
Environment:OSX/brew
-
Not Needed
Problem Statement/Rationale
It appears a regression has been introduced on the mongosh helper methods on ObjectId() for valueOf() and str.
The str getter doesn't list at all in the prototype, and calling either str or valueOf() returns undefined.
Steps to Reproduce
mongosh
// str test typeof new ObjectId().str; // valueOf() test typeof new ObjectId().valueOf(); // toHexString() test typeof new ObjectId().toHexString();
Expected Results
mongosh
// str test typeof new ObjectId().str; string // valueOf() test typeof new ObjectId().valueOf(); string // toHexString() test typeof new ObjectId().toHexString(); string
Actual Results
mongosh
// str test typeof new ObjectId().str; undefined // valueOf() test typeof new ObjectId().valueOf(); undefined // toHexString() test typeof new ObjectId().toHexString(); string
- duplicates
-
MONGOSH-1265 `ObjectId.valueOf()`, `ObjectId.toString()` and `ObjectId.str` differs from the docs
- Closed