Change Object ID display format from '{$oid: 'xxxx'}' to ObjectId('xxxxx')
It just uses only 1 line instead 3 lines. And we can copy it directly.
3
votes
![](https://secure.gravatar.com/avatar/b5862970eae920c1e7c9cb3cc7b439b5?size=40&default=https%3A%2F%2Fassets.uvcdn.com%2Fpkg%2Fadmin%2Ficons%2Fuser_70-6bcf9e08938533adb9bac95c3e487cb2a6d4a32f890ca6fdc82e3072e0ea0368.png)
-
Yaniv Bahalker commented
Totally agree with you.
If you return a format of `{$oid: "..."}` I'm expecting it to work in the playground but it isn't.
When trying to use $oid in playground it show error "unknown operator: $oid".
So my workaround for now instead of manually change is to use regex (\{\s*\n*"\$oid":\s"(\w+)"\s*\n*\}) and replace with ObjectId("$1").Same thing for dates and ISODate...