-
Type: Improvement
-
Resolution: Unresolved
-
Priority: Unknown
-
None
-
Affects Version/s: None
-
Component/s: Laravel
-
None
https://github.com/GromNaN/laravel-mongodb-private/pull/4#discussion_r1259060154
This looks like a bug in:
laravel-mongodb-private/src/Query/Builder.phpLines 251 to 257 in 06d3624
I'm not sure why $last is used (the MySQL reference is lost on me), but there definitely needs to be some logic to avoid clobbering the _id field of the $group stage. If you actually want the incoming document's _id field to end up in a grouping, you need to project it into another field name. I'm not sure if there's an easy way to do that given the existing API but adding ['$last' => '$_id'] to the group ID seems very incorrect (even before we consider it being omitted from the output alongside "email").
- depends on
-
PHPORM-103 Integrate Aggregation builder into Laravel library
- Development Complete