Hi everyone,
I’m encountering an issue with the MongoDB Search Documents module and could use some help.
I’m trying to search for a document in the jobs
collection where the project
field matches a specific ObjectId
. The project
field in my MongoDB collection is stored as an ObjectId
, and in Make, I’ve set up the data structure for jobs
with project
defined as a collection of $oid
.
Here’s the query I’m trying to run:
{ "project": "ObjectId(project_id)" }
But it returns no results.
I’ve tried the same approach with another field called user
, which is also an ObjectId
, and I get the same result — nothing, even though I know for sure that the document exists.
When I run this query:
{ "_id": "ObjectId(job_id)" }
It returns the correct document. The _id
field is defined exactly the same way (as a collection of $oid
).
So far, I’ve tried:
- Removing the
project
field from the data structure - Changing
project
to a plain text field - Re-saving the data structure
Nothing seems to work for fields other than _id
. Is there a known issue with matching non-_id
ObjectId
fields, or am I missing something in the way Make handles these queries?
Any guidance or workarounds would be appreciated!
Thanks in advance.