Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot group with more than one field name #75

Closed
prusfr opened this issue Sep 11, 2023 · 2 comments · Fixed by #76
Closed

Cannot group with more than one field name #75

prusfr opened this issue Sep 11, 2023 · 2 comments · Fixed by #76
Assignees
Labels
bug Something isn't working documentation Improvements or additions to documentation

Comments

@prusfr
Copy link

prusfr commented Sep 11, 2023

Pipeline.group() method wont' allow more than 1 field name of class string, whereas doc indicates set or list can be passed.
Example :
Pipeline().group(by=["field1", "field2"]) will throw an error.
Thus, multi-fields group cannot be set and such a syntax : {$group: {$_id : { field1: "$field1", field2: "$field2"}}} cannot be achived

@VianneyMI VianneyMI self-assigned this Sep 14, 2023
@VianneyMI VianneyMI added bug Something isn't working documentation Improvements or additions to documentation labels Sep 14, 2023
@VianneyMI
Copy link
Owner

Thanks for the report.

Yes the doc is a bit misleading. I am currently working on creating a proper documentation for the package.
I'll fix this soon.

In the meantime you can still write:

Pipeline().group(    
        query = {
            "field1":"$field1",
            "field2":"$field2",
        }
    )

@VianneyMI VianneyMI linked a pull request Sep 15, 2023 that will close this issue
5 tasks
@VianneyMI
Copy link
Owner

Fixed in 0.16.2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants