feat: Add support for MongoDB query comment (#8928)
This commit is contained in:
@@ -19,6 +19,10 @@ export class AggregateRouter extends ClassesRouter {
|
||||
options.explain = body.explain;
|
||||
delete body.explain;
|
||||
}
|
||||
if (body.comment) {
|
||||
options.comment = body.comment;
|
||||
delete body.comment;
|
||||
}
|
||||
if (body.readPreference) {
|
||||
options.readPreference = body.readPreference;
|
||||
delete body.readPreference;
|
||||
|
||||
@@ -166,6 +166,7 @@ export class ClassesRouter extends PromiseRouter {
|
||||
'subqueryReadPreference',
|
||||
'hint',
|
||||
'explain',
|
||||
'comment',
|
||||
];
|
||||
|
||||
for (const key of Object.keys(body)) {
|
||||
@@ -215,6 +216,9 @@ export class ClassesRouter extends PromiseRouter {
|
||||
if (body.explain) {
|
||||
options.explain = body.explain;
|
||||
}
|
||||
if (body.comment && typeof body.comment === 'string') {
|
||||
options.comment = body.comment;
|
||||
}
|
||||
return options;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user