MongoDB-PHP-GUI
MongoDB-PHP-GUI copied to clipboard
How to query an ObjectId field not named _id?
I cannot query based on objectId in this thing. {key: "<id>"} doesn't work {key: ObjectId("<id>")} doesn't work either!
Let ObjectId("6f358e03c3360000ef0076d4"), you can query with:
{ _id: "6f358e03c3360000ef0076d4" }
or
_id: "6f358e03c3360000ef0076d4"
The key in my case is "definitionId" it is not the _id and no this doesn't work
{definitionId: "someid"}
Ah! That's why! 😉 Only ObjectId fields named _id are supported by MongoDB PHP GUI for now.