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

Support for some additional query Expressions #2376

Open hjardines opened 3 years ago

hjardines commented 3 years ago

Feature Request

MongoDB v3.2 introduced $arrayElemAt as an Aggregation expression (among many others), which is very useful to filter for Arrays of Embedded documents at a given position, typically "first" or "last". Ref: https://docs.mongodb.com/manual/reference/operator/aggregation/arrayElemAt/

Then later MongoDB v3.6 introduced the ability of using the same "operators" for regular queries. Quote: "The $expr allows the use of aggregation expressions within the query language." Ref : https://docs.mongodb.com/manual/release-notes/3.6/

Q A
New Feature yes
RFC yes
BC Break no

Summary

I use Query Builder a lot, and prefer it a lot over the Aggregation Builder whenever is possible.

Is this something being looked upon on? Thanks a lot for all the hard work.

malarzm commented 3 years ago

We know we're lagging a lot with operators and at this point I'm not sure we'll be able to add all of them at once like we always wanted. I think we need do start adding them as requests pop up, so @hjardines if you have some time on your hands we'd greatly appreciate a PR adding them!