I created an issue to the original repository just in case someone has the same issue. What was noticed is that the library creates an index https://github.com/flash-oss/node_acl/blob/966d079e3a2cda9a8243400e29fde857b0349c11/lib/mongodb-backend.js#L145 and then in the case of the useSingle=false we are not using this index as we are querying with just the key meaning we are not using the index resulting to slow queries. Maybe the index could respect the useSingle flag and create the correct index.
I created an issue to the original repository just in case someone has the same issue. What was noticed is that the library creates an index https://github.com/flash-oss/node_acl/blob/966d079e3a2cda9a8243400e29fde857b0349c11/lib/mongodb-backend.js#L145 and then in the case of the
useSingle=false
we are not using this index as we are querying with just thekey
meaning we are not using the index resulting to slow queries. Maybe the index could respect theuseSingle
flag and create the correct index.https://github.com/flash-oss/node_acl/blob/966d079e3a2cda9a8243400e29fde857b0349c11/lib/mongodb-backend.js#L121