adds ability to set hint on Parse.Query #6288 (#6322)

* added hint to aggregate

* added support for hint in query

* added else clause to aggregate

* fixed tests

* updated tests

* Add tests and clean up

* Add support for explain

Co-authored-by: Diamond Lewis <findlewis@gmail.com>
This commit is contained in:
stevestencil
2020-01-14 01:14:43 -07:00
committed by Diamond Lewis
parent 5a1d94ed88
commit 9842c6ee42
9 changed files with 267 additions and 21 deletions

View File

@@ -173,6 +173,8 @@ export class ClassesRouter extends PromiseRouter {
'readPreference',
'includeReadPreference',
'subqueryReadPreference',
'hint',
'explain',
];
for (const key of Object.keys(body)) {
@@ -219,6 +221,15 @@ export class ClassesRouter extends PromiseRouter {
if (typeof body.subqueryReadPreference === 'string') {
options.subqueryReadPreference = body.subqueryReadPreference;
}
if (
body.hint &&
(typeof body.hint === 'string' || typeof body.hint === 'object')
) {
options.hint = body.hint;
}
if (body.explain) {
options.explain = body.explain;
}
return options;
}