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

Missing accumulator operator $median in definition #15209

Closed
2 tasks done
eherve opened this issue Jan 28, 2025 · 1 comment · Fixed by #15233
Closed
2 tasks done

Missing accumulator operator $median in definition #15209

eherve opened this issue Jan 28, 2025 · 1 comment · Fixed by #15233

Comments

@eherve
Copy link

eherve commented Jan 28, 2025

Prerequisites

  • I have written a descriptive issue title
  • I have searched existing issues to ensure the bug has not already been reported

Mongoose version

8.9.5

Node.js version

20.11.1

MongoDB server version

8

Typescript version (if applicable)

5.6.3

Description

I'm trying to calculate median from metrics, but the AccumulatorOperator does not declare $median operator. I have a unknown property error on my $group pipeline.

Steps to Reproduce

mode.aggregate([ { $group: { _id: null, median: { $median: { input: '$value', method: 'approximate' } }, } } ])
ERROR : Object literal may only specify known properties, and '$median' does not exist in type 'AccumulatorOperator'.

Expected Behavior

No response

@eherve
Copy link
Author

eherve commented Jan 28, 2025

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant