Yep - AFAIK, when you pass the PartitionKey in your query using the .NET SDK for Cosmos DB, it automatically restricts the query to only return results from that exact partition. You do not need to explicitly add WHERE PartitionKey = @PartitionKey
in your query.
Cosmos DB internally routes your request to the correct physical partition based on the provided PartitionKey
. The query execution is scoped to that partition, so the filtering is implicitly applied.
If the above response helps answer your question, remember to "Accept Answer" so that others in the community facing similar issues can easily find the solution. Your contribution is highly appreciated.
hth
Marcin