Details
-
Bug
-
Status: Closed
-
Major - P3
-
Resolution: Duplicate
-
1.8.0
-
None
-
OSX/brew
-
Not Needed
Description
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
|
Attachments
Issue Links
- duplicates
-
MONGOSH-1265 `ObjectId.valueOf()`, `ObjectId.toString()` and `ObjectId.str` differs from the docs
-
- Closed
-