Open markitosgv opened 1 month ago
pd2. is working if I put an unwind before lookup for users field (is an array of user ids)
Does this mean the issue is completely resolved. We can close if so.
However this query if I run it from a mongo client works fine, so I suspect that there is a problem with the driver or the php library.
There is not much logic in the PHP extension or library that would interfere with execution of an aggregation pipeline (unless it was a bug in the new query builder). It's more likely that the issue is in constructing the pipeline itself, which the driver appends to an outgoing aggregate
command. In that case, it'd be helpful to see actually PHP code to investigate instead of just the mongosh
example shared in the OP.
Also, "query keeps running" in the title and "when executed remains undefined" in the OP text seems contradictory. If the query is still executing on the server you wouldn't get any response in the PHP driver and likely hit a socket timeout. But if the library's Collection::aggregate()
method does return a cursor with no results, that implies the query has completed and returned an unexpected result.
Bug Report
Environment
I have a cluster in mongo 6, testing I have migrated to mongo 8, with the 1.20 driver.
There is an aggregate query that when executed remains undefined, are the same indexes and all the same as the dataset of mongo 6.
However this query if I run it from a mongo client works fine, so I suspect that there is a problem with the driver or the php library.
Its something related to lookup query, because if I remove lookup it works ok. So maybe is something I'm missingn about new way to do lookup queries on mongo 8?
the query is this:
env data:
thanks
pd. on mongodb 7 I'm having same issue
pd2. is working if I put an unwind before lookup for users field (is an array of user ids)