@flowerforce/flowerbase 1.1.0 → 1.1.1-beta.0
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/services/mongodb-atlas/index.ts"],"names":[],"mappings":"AAKA,OAAO,EAAyC,oBAAoB,EAAE,MAAM,SAAS,CAAA;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/services/mongodb-atlas/index.ts"],"names":[],"mappings":"AAKA,OAAO,EAAyC,oBAAoB,EAAE,MAAM,SAAS,CAAA;AAmpBrF,QAAA,MAAM,YAAY,EAAE,oBAmBlB,CAAA;AAEF,eAAe,YAAY,CAAA"}
|
|
@@ -235,8 +235,9 @@ const getOperators = (collection, { rules = {}, collName, user, run_as_system })
|
|
|
235
235
|
const { filters, roles } = rules[collName] || {};
|
|
236
236
|
// Pre-query filtering based on access control rules
|
|
237
237
|
const formattedQuery = (0, utils_2.getFormattedQuery)(filters, query, user);
|
|
238
|
+
const currentQuery = formattedQuery.length ? { $and: formattedQuery } : {};
|
|
238
239
|
// aggiunto filter per evitare questo errore: $and argument's entries must be objects
|
|
239
|
-
const originalCursor = collection.find(
|
|
240
|
+
const originalCursor = collection.find(currentQuery);
|
|
240
241
|
// Clone the cursor to override `toArray` with post-query validation
|
|
241
242
|
const client = originalCursor['client'];
|
|
242
243
|
const newCursor = new mongodb_1.FindCursor(client);
|
package/package.json
CHANGED
|
@@ -270,8 +270,9 @@ const getOperators: GetOperatorsFunction = (
|
|
|
270
270
|
|
|
271
271
|
// Pre-query filtering based on access control rules
|
|
272
272
|
const formattedQuery = getFormattedQuery(filters, query, user)
|
|
273
|
+
const currentQuery = formattedQuery.length ? { $and: formattedQuery } : {}
|
|
273
274
|
// aggiunto filter per evitare questo errore: $and argument's entries must be objects
|
|
274
|
-
const originalCursor = collection.find(
|
|
275
|
+
const originalCursor = collection.find(currentQuery)
|
|
275
276
|
// Clone the cursor to override `toArray` with post-query validation
|
|
276
277
|
const client = originalCursor[
|
|
277
278
|
'client' as keyof typeof originalCursor
|