firstly, let's take this simple query as example:
ObjectId('62663def4e578b0a1cb482c5').valueOf();
output in DataGrip v2021.3.1:
{"$oid": "62663def4e578b0a1cb482c5"}
output in Navicat for MongoDB v16.0.14:
62663def4e578b0a1cb482c5
output in mongosh 1.5.0:
ObjectId("62663def4e578b0a1cb482c5")
secondly, with typeof operator, i.e.:
typeof ObjectId('62663def4e578b0a1cb482c5').valueOf();, we can see the data type of the output. they are object in both DataGrip and Mongosh but string in Navicat for MongoDb.
This is an obvious issue and problematic when developers write complex queries, I believe there must be tickets raised for similar issue(but i haven't found one).
Why it it like this? It could be due to different mongoDB driver version integrated in each client but I searched around and haven't found any solid official documents. Could anyone help on this?