Skip to content

Commit 3daefbc

Browse files
committed
Ignore AggregateRouter undefined pipline operators.
1 parent 9183e8e commit 3daefbc

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/Routers/AggregateRouter.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,9 +79,11 @@ export class AggregateRouter extends ClassesRouter {
7979
static getPipeline(body) {
8080
let pipeline = body.pipeline || body;
8181
if (!Array.isArray(pipeline)) {
82-
pipeline = Object.keys(pipeline).map(key => {
83-
return { [key]: pipeline[key] };
84-
});
82+
pipeline = Object.keys(pipeline)
83+
.filter(key => pipeline[key] !== undefined)
84+
.map(key => {
85+
return { [key]: pipeline[key] };
86+
});
8587
}
8688

8789
return pipeline.map(stage => {

0 commit comments

Comments
 (0)