Skip to content

Commit

Permalink
Handle AggregateRouter falsy body values.
Browse files Browse the repository at this point in the history
  • Loading branch information
Chilldev committed Oct 15, 2024
1 parent 580faac commit e155167
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/Routers/AggregateRouter.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,20 +11,20 @@ export class AggregateRouter extends ClassesRouter {
if (body.distinct) {
options.distinct = String(body.distinct);
}
if (body.hint) {
options.hint = body.hint;
if (Object.prototype.hasOwnProperty.call(body, 'hint')) {
if (body.hint) options.hint = body.hint;
delete body.hint;
}
if (body.explain) {
options.explain = body.explain;
if (Object.prototype.hasOwnProperty.call(body, 'explain')) {
if (body.explain) options.explain = body.explain;
delete body.explain;
}
if (body.comment) {
options.comment = body.comment;
if (Object.prototype.hasOwnProperty.call(body, 'comment')) {
if (body.comment) options.comment = body.comment;
delete body.comment;
}
if (body.readPreference) {
options.readPreference = body.readPreference;
if (Object.prototype.hasOwnProperty.call(body, 'readPreference')) {
if (body.readPreference) options.readPreference = body.readPreference;
delete body.readPreference;
}
options.pipeline = AggregateRouter.getPipeline(body);
Expand Down

0 comments on commit e155167

Please sign in to comment.