I have a collection in mongoDb where each document has a list of users.
{
"_id" : ObjectId("62a0b5b7ac0059883db3f5f7"),
"name":"dummy1",
"priority":"high",
"users" : [
ObjectId("628b96bf192398a52a6bfb87"),
ObjectId("626165202d5ef7e3085e0c7g"),
ObjectId("627021a0740e7a66700a000b") ]
}
The users array has the _id of users who have access to this document.This array would have max 5-10 items inside it. But it can vary a lot in terms of values inside it since there are thousands of users. Is it advisable to create a multiKey index on the "users" key?