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:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user