Skip to content

Unrecognized expression '$last' #1873

Open
@dpapala

Description

@dpapala

Hi,
i'm using this query
models_types::orderby('manufacturer_name')->groupby('manufacturer_name')->pluck('manufacturer_name','_id');
so that to get an array with these 2 fields. If i remove the groupby works fine but with it i get the error Unrecognized expression '$last'
With this query i want to retrieve distinct values of manufacturer_name in a collection that i have many documents with many manufacturers.
The issue comes up if i want to retrieve the object id.

I use
Laravel 6.2
PHP 7.3
MongoDB 4.2

Metadata

Metadata

Assignees

No one assigned

    Labels

    Needs investigationNeed investigation about bugs described in issue

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions