Create the following index:
db.privileges.createIndex(
{ userId: 1, resourceId: 1 }
)This index will speed up queries based on userId (i.e. retrieve all the privileges of a given user) and userId-resourceId (i.e. retrieve user privileges for specific resources).
Additionally, fix the method upsertPrivilege of PrivilegesRepository in order to leverage the new index

Please authenticate to join the conversation.
Completed
Bug & Fixes
11 months ago

Ivan Ligotino
Get notified by email when there are changes.
Completed
Bug & Fixes
11 months ago

Ivan Ligotino
Get notified by email when there are changes.