I’m looking for a good way to implement a requirement I have. I need to be able to lookup documents that exactly match the three parameters my documents have in the following ways
Site Identifier + UserIdentifier
SiteIdentifier +UserIdentifier + Type
SiteIdentifier + Type
SiteIdentifier and Type will always be present on these objects, however UserIdentifier is not.
I’m not sure how to best structure my indexes.
I’m currently thinking about and index for each unique query I would need to run. I looked at composite keys, which I would need here and I know I can do an exact query, but is there any way to do it without having 4 indexes? Maybe I am trying to solve a problem I don’t really have.
The use case for this is to be able to delete the keys that are returned. I wrote the same thing using N1QL and got it to work, but I am not sure if using indexes would be faster.