doctrine / mongodb-odm

The Official PHP MongoDB ORM/ODM
https://www.doctrine-project.org/projects/doctrine-mongodb-odm/en/latest/
MIT License
1.09k stars 504 forks source link

Starting in MongoDB 5.1, $lookup and graphLookup works across sharded collections #2479

Closed theyough closed 1 year ago

theyough commented 2 years ago

Following the new release

Starting in MongoDB 5.1, $lookup works across sharded collections

Stack

php -v : 7.4 ext-mongo: 1.14.2 https://www.mongodb.com/docs/drivers/php/#compatibility, this version is fully compatible with mongo 6.0

With api platform i get this error :

 as collection for lookup or graphLookup stage. Sharded collections are not allowed.

from this file, i commented https://github.com/doctrine/mongodb-odm/blob/f5c16795858ab537922ead80eb122927f6d78686/lib/Doctrine/ODM/MongoDB/Aggregation/Stage/Lookup.php#L90-L93

I don't get any error from mongo-odm or mongo

malarzm commented 2 years ago

In this case we'll happily remove restriction :) From what I see $graphLookup is no longer restricted since MongoDB 5.1 as well. @theyough mind opening a PR for 2.4.x branch? That way we'll be able to release it quickly.

malarzm commented 1 year ago

Closing as https://github.com/doctrine/mongodb-odm/pull/2494 got merged