I have several shard-(ed) collections. The collection is user requests. and the shard key is User Id.
I have a field named "Execution Time" and I want query all the requests in a period of time (lte and gte).
The index is with the shard key, but my query is without. I would like not to put all the shard Key in query with a "in" operator because I have a 1000 shard keys (users).. futher more to do that i need to get all user ids on every query - it means 2 queries each time instead of 1.
But still i want to use an index.. what option is to add userId > 0 < maxUserId to the query?
What is the right approach?
Thanks in advance