You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When adding a filter, it goes always in first stage. If the query already have a match two stages will be created, making mongodb throw an exception. Documentation states that $match stage that includes a $text must be the first stage in the pipeline.
Current behavior
The stage that comes from filters will always be the first in pipeline.
How to reproduce
create a filter
final class ExcludeSoftDeletedFilter extends BsonFilter
{
public function addFilterCriteria(ClassMetadata $targetDocument): array
{
return [
'deletedAt' => null,
];
}
}
An exception occured, transforming to an Error resource. {"exception":"[object] (MongoDB\\Driver\\Exception\\CommandException(code: 17313): $match with $text is only allowed as the first pipeline stage at /var/www/html/vendor/mongodb/mongodb/src/Operation/Aggregate.php:383
Expected behavior
In my opinion, the CriteriaMerger should be used when merging the attributes, or there should be a "reorder" before submitting the query, so the text stage should go first
The text was updated successfully, but these errors were encountered:
Bug Report
Summary
When adding a filter, it goes always in first stage. If the query already have a match two stages will be created, making mongodb throw an exception.
Documentation states that $match stage that includes a $text must be the first stage in the pipeline.
Current behavior
The stage that comes from filters will always be the first in pipeline.
How to reproduce
Expected behavior
In my opinion, the CriteriaMerger should be used when merging the attributes, or there should be a "reorder" before submitting the query, so the text stage should go first
The text was updated successfully, but these errors were encountered: