Fix select exclude queries (#7242)

* fix keys and excludeKeys to work with JSON array strings

* make excludeKeys test more robust

* add changelog

* add select([]) functionality to fix)

* update changelog

* update keys

* add exclude test

* add select REST test and exclude JS SDK test

* add more tests

* add additional exclude test

* improved select test for testing JSON string array in REST

* improved exclude test for testing JSON string array in REST

* check for parse keys

* make include look like keys and excludeKeys

* nit

* Exclude nexted child fields

* add updates and show failing testcases

* working

* add more tests

* even more test cases

* use await for added tests

* lint

* Add suggestions
This commit is contained in:
Corey
2021-06-03 15:54:44 -04:00
committed by GitHub
parent 5abbeeb8d1
commit 6d13aeae2c
4 changed files with 581 additions and 97 deletions

View File

@@ -57,14 +57,14 @@ export class ClassesRouter extends PromiseRouter {
}
}
if (typeof body.keys === 'string') {
options.keys = body.keys;
if (body.keys != null) {
options.keys = String(body.keys);
}
if (body.include) {
if (body.include != null) {
options.include = String(body.include);
}
if (typeof body.excludeKeys == 'string') {
options.excludeKeys = body.excludeKeys;
if (body.excludeKeys != null) {
options.excludeKeys = String(body.excludeKeys);
}
if (typeof body.readPreference === 'string') {
options.readPreference = body.readPreference;
@@ -187,13 +187,13 @@ export class ClassesRouter extends PromiseRouter {
if (body.count) {
options.count = true;
}
if (typeof body.keys == 'string') {
options.keys = body.keys;
if (body.keys != null) {
options.keys = String(body.keys);
}
if (typeof body.excludeKeys == 'string') {
options.excludeKeys = body.excludeKeys;
if (body.excludeKeys != null) {
options.excludeKeys = String(body.excludeKeys);
}
if (body.include) {
if (body.include != null) {
options.include = String(body.include);
}
if (body.includeAll) {