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

Add AggregationMethod to Document and UnionDoc #1052

Closed
wants to merge 5 commits into from

Conversation

CAPITAINMARVEL
Copy link
Contributor

@CAPITAINMARVEL CAPITAINMARVEL commented Oct 11, 2024

This PR is to allow the use of aggregation method directly after Document or UnionDoc class like the document mention in
https://beanie-odm.dev/tutorial/aggregation/

# With a search:
avg_price = await Product.find(
    Product.category.name == "Chocolate"
).avg(Product.price)

# Over the whole collection:
avg_price = await Product.avg(Product.price)

which isnt possible since Product doesnt inherit from AggregationMethod

@CAPITAINMARVEL CAPITAINMARVEL marked this pull request as draft October 14, 2024 13:36
Copy link
Contributor

This PR is stale because it has been open 45 days with no activity.

@github-actions github-actions bot added the Stale label Nov 29, 2024
@CAPITAINMARVEL CAPITAINMARVEL marked this pull request as ready for review December 13, 2024 01:00
@CAPITAINMARVEL CAPITAINMARVEL deleted the fix_aggregate branch December 13, 2024 14:11
@CAPITAINMARVEL CAPITAINMARVEL restored the fix_aggregate branch December 13, 2024 14:13
@CAPITAINMARVEL CAPITAINMARVEL deleted the fix_aggregate branch December 13, 2024 14:14
@CAPITAINMARVEL CAPITAINMARVEL restored the fix_aggregate branch December 13, 2024 14:48
Copy link
Contributor

This PR is stale because it has been open 45 days with no activity.

@github-actions github-actions bot added the Stale label Jan 28, 2025
Copy link
Contributor

This PR was closed because it has been stalled for 14 days with no activity.

@github-actions github-actions bot closed this Feb 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants