Skip to Main Content

MongoByte MongoDB Logo

Welcome to the new MongoDB Feedback Portal!

{Improvement: "Your idea"}
We’ve upgraded our system to better capture and act on your feedback.
Your feedback is meaningful and helps us build better products.

Status Submitted
Categories IDEs
Created by Guest
Created on Jun 14, 2022

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.
  • Guest
    Apr 10, 2023
    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...