Skip to content

Commit e155167

Browse files
committed
Handle AggregateRouter falsy body values.
1 parent 580faac commit e155167

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

src/Routers/AggregateRouter.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,20 +11,20 @@ export class AggregateRouter extends ClassesRouter {
1111
if (body.distinct) {
1212
options.distinct = String(body.distinct);
1313
}
14-
if (body.hint) {
15-
options.hint = body.hint;
14+
if (Object.prototype.hasOwnProperty.call(body, 'hint')) {
15+
if (body.hint) options.hint = body.hint;
1616
delete body.hint;
1717
}
18-
if (body.explain) {
19-
options.explain = body.explain;
18+
if (Object.prototype.hasOwnProperty.call(body, 'explain')) {
19+
if (body.explain) options.explain = body.explain;
2020
delete body.explain;
2121
}
22-
if (body.comment) {
23-
options.comment = body.comment;
22+
if (Object.prototype.hasOwnProperty.call(body, 'comment')) {
23+
if (body.comment) options.comment = body.comment;
2424
delete body.comment;
2525
}
26-
if (body.readPreference) {
27-
options.readPreference = body.readPreference;
26+
if (Object.prototype.hasOwnProperty.call(body, 'readPreference')) {
27+
if (body.readPreference) options.readPreference = body.readPreference;
2828
delete body.readPreference;
2929
}
3030
options.pipeline = AggregateRouter.getPipeline(body);

0 commit comments

Comments
 (0)