find("_id": {"$oid": "5eb8ebd93e7356145d17273b"}) didn't work.
Answered
DataGrip view as json display this:

But when i look for this data like this:
db.xxxx.find("_id": {"$oid": "5eb8ebd93e7356145d17273b"})
It returns an error:
"Query failed with error code 2 and error message 'unknown operator: $oid'
And look for like this can success:
db.xxxx.find({"_id": {"objectId": "5c7934944bbf5f1d900039d9"}})
This is a bug or a special design?
Looking forward to replay!
Please sign in to leave a comment.
Hello @291712141
It's not a bug. It's an extended JSON format https://docs.mongodb.com/manual/reference/mongodb-extended-json/
This format allows to save type information
You would get the same value if you run mongoexport tool
MongoDB does not allow you to query using extended JSON.

Neither `{"$oid": "5eb8ebd93e7356145d17273b"}` nor `{"objectId": "5c7934944bbf5f1d900039d9"}` will succeed in mongo shell and in DataGrip. You should use different syntax: `{"_id": ObjectId('5eb8ebd93e7356145d17273b')}`
IDE can generate this filter for you
You can open a Table View and in context menu find Filter By
Is there a way to disable this behaviour? There is this:
And then there is date columns:
I want original output which I can copy and use in insertOne command too. Is there a setting I can turn off?
Sbmaggarwal Unfortunately no, in order to achieve what you want, you would have to manually convert these fields to their original format