Cannot convert ObjectId to hexadecimal string
Solved
I have tried all these methods
ObjectId().str ObjectId().String() ObjectId().valueOf() _.toString(ObjectId())But I couldn't find one way to get the hexadecimal string of ObjectId. Both ObjectId().str and ObjectId.valueOf() works in mongoshell, and they don't work in NoSqlBooster.
Which version are you using? If you are using 4.5.1 and below,
please use "ObjectID.toHexString()" as a work around solution.
let id=new ObjectID();
id. toHexString ();
//return 5ab8b40d4b8a25a8ccde6ae0
Or, you can download 4.5.2 manually, and use "ObjectId().valueOf()"
https://nosqlbooster.com/downloads
Which version are you using? If you are using 4.5.1 and below,
please use "ObjectID.toHexString()" as a work around solution.
let id=new ObjectID();
id. toHexString ();
//return 5ab8b40d4b8a25a8ccde6ae0
Or, you can download 4.5.2 manually, and use "ObjectId().valueOf()"
https://nosqlbooster.com/downloads
Replies have been locked on this page!