drapcode-utility 2.0.2 → 2.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -16,12 +16,12 @@ const queryBuilder = async (collectionName, query, constants, externalParams, au
|
|
|
16
16
|
// Apply both filters using the helper
|
|
17
17
|
applyFilterQuery(query, finalQuery, externalParams, constants, timezone, authDetail);
|
|
18
18
|
console.log("After main query check: ", JSON.stringify(finalQuery));
|
|
19
|
-
finalQuery = simplifyMongoQuery(finalQuery);
|
|
20
|
-
console.log("After main simplifyMongoQuery: ", JSON.stringify(finalQuery));
|
|
19
|
+
// finalQuery = simplifyMongoQuery(finalQuery);
|
|
20
|
+
// console.log("After main simplifyMongoQuery: ", JSON.stringify(finalQuery));
|
|
21
21
|
applyFilterQuery(rowLevelSecurityFilter, finalQuery, externalParams, constants, timezone, authDetail);
|
|
22
22
|
console.log("After RLS query check: ", JSON.stringify(finalQuery));
|
|
23
|
-
finalQuery = simplifyMongoQuery(finalQuery);
|
|
24
|
-
console.log("After RLS simplifyMongoQuery: ", JSON.stringify(finalQuery));
|
|
23
|
+
// finalQuery = simplifyMongoQuery(finalQuery);
|
|
24
|
+
// console.log("After RLS simplifyMongoQuery: ", JSON.stringify(finalQuery));
|
|
25
25
|
console.log(`==> searchQueryTypeObj :>>`, searchQueryTypeObj);
|
|
26
26
|
let aggregateQuery = [];
|
|
27
27
|
let searchQueryObj = null;
|
|
@@ -61,6 +61,8 @@ const queryBuilder = async (collectionName, query, constants, externalParams, au
|
|
|
61
61
|
finalQuery.$and.push(...additionalFilters);
|
|
62
62
|
}
|
|
63
63
|
console.log("7");
|
|
64
|
+
finalQuery = simplifyMongoQuery(finalQuery);
|
|
65
|
+
console.log("After all simplifyMongoQuery: ", JSON.stringify(finalQuery));
|
|
64
66
|
//Remove empty and in final query
|
|
65
67
|
if (!finalQuery?.$and?.length) {
|
|
66
68
|
delete finalQuery.$and;
|
|
@@ -231,7 +233,6 @@ const conditionToQuery = (query, requiredExternal, externalParams, constants, ti
|
|
|
231
233
|
}
|
|
232
234
|
console.log("No date range constants");
|
|
233
235
|
let fieldValue = changeExternalParams(query, requiredExternal, externalParams, constants, timezone, authDetail);
|
|
234
|
-
console.log("After External Params replacements: ", fieldValue);
|
|
235
236
|
if (["undefined", "null", null, undefined, ""].includes(fieldValue)) {
|
|
236
237
|
//Assign some random value if fieldValue is missing from old records
|
|
237
238
|
fieldValue = noFieldString;
|