-
-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
Aggregate allow multiple of same stage #4835
Conversation
Codecov Report
@@ Coverage Diff @@
## master #4835 +/- ##
==========================================
- Coverage 92.8% 92.77% -0.03%
==========================================
Files 119 119
Lines 8751 8760 +9
==========================================
+ Hits 8121 8127 +6
- Misses 630 633 +3
Continue to review full report at Codecov.
|
@oallouch Sorry this took so long. How does it look? |
Don't be sorry. You rock ! Thx again |
@flovilmart How does this look? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One small nit for the maintainability. Otherwise looks good.
src/Routers/AggregateRouter.js
Outdated
@@ -7,57 +7,51 @@ import UsersRouter from './UsersRouter'; | |||
const ALLOWED_KEYS = [ | |||
'where', | |||
'distinct', | |||
'project', | |||
'addFields', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we make a list of PIPELINE_KEYS
and BASE_KEYS
and concat them in ALLOWED_KEYS
for readability?
src/Routers/AggregateRouter.js
Outdated
@@ -34,6 +34,8 @@ const ALLOWED_KEYS = [ | |||
'unwind', | |||
]; | |||
|
|||
const ALLOWED_KEYS = BASE_KEYS.concat(PIPELINE_KEYS); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will mutate BASE_KEYS IIRC :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Concat docs say it doesn’t mutate
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok my bad, getting a bit rusty :p spread is quite nice :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Alright! My bad :/
* Aggregate Allow Multiple Stages * remove testing files * nit * spread them
* Aggregate Allow Multiple Stages * remove testing files * nit * spread them
* Aggregate Allow Multiple Stages * remove testing files * nit * spread them
Closes: #4682
Also added Mongo 3.6 aggregates stages. (sorted aphabetically)
Will update JS SDK to take array priority over object once merged.