Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to query an ObjectId field not named _id? #39

Open
aldokkani opened this issue Oct 14, 2022 · 3 comments
Open

How to query an ObjectId field not named _id? #39

aldokkani opened this issue Oct 14, 2022 · 3 comments

Comments

@aldokkani
Copy link

aldokkani commented Oct 14, 2022

I cannot query based on objectId in this thing.
{key: "<id>"} doesn't work
{key: ObjectId("<id>")} doesn't work either!

@SamuelTallet
Copy link
Owner

Let ObjectId("6f358e03c3360000ef0076d4"), you can query with:

{ _id: "6f358e03c3360000ef0076d4" }

or

_id: "6f358e03c3360000ef0076d4"

@aldokkani
Copy link
Author

The key in my case is "definitionId" it is not the _id and no this doesn't work
{definitionId: "someid"}

@SamuelTallet SamuelTallet reopened this Oct 28, 2022
@SamuelTallet
Copy link
Owner

Ah! That's why! 😉 Only ObjectId fields named _id are supported by MongoDB PHP GUI for now.

@SamuelTallet SamuelTallet changed the title How to query ObjectId with this? How to query an ObjectId field not named _id? Oct 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants