-
-
Notifications
You must be signed in to change notification settings - Fork 4.8k
Aggregate allow multiple of same stage #4835
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
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,9 +4,9 @@ import * as middleware from '../middlewares'; | |
import Parse from 'parse/node'; | ||
import UsersRouter from './UsersRouter'; | ||
|
||
const ALLOWED_KEYS = [ | ||
'where', | ||
'distinct', | ||
const BASE_KEYS = ['where', 'distinct']; | ||
|
||
const PIPELINE_KEYS = [ | ||
'addFields', | ||
'bucket', | ||
'bucketAuto', | ||
|
@@ -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 commentThe 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 commentThe 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 commentThe reason will be displayed to describe this comment to others. Learn more. Ok my bad, getting a bit rusty :p spread is quite nice :) |
||
|
||
export class AggregateRouter extends ClassesRouter { | ||
|
||
handleFind(req) { | ||
|
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
andBASE_KEYS
and concat them inALLOWED_KEYS
for readability?