Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

There are several reasons why querying by partition key using EF Core Cosmos DB may not yield any results:

  1. Partition Key Value: Ensure that the partition key value being used in the query matches the value that was used when creating the document. If the partition key value is incorrect, the query will not return any results.

  2. Partition Key Definition: Ensure that the partition key definition in the model is correct. The partition key property needs to be annotated with the [PartitionKey] attribute and its name needs to match the partition key property in the document.

  3. Consistency Level: EF Core Cosmos DB supports strong consistency as well as eventual consistency. If the consistency level used for the query is different from the consistency level used when the document was created, the query may not return any results.

  4. Indexing: Ensure that the document is indexed properly. If the indexing is not set up correctly, the query may not return any results.

  5. Query Syntax: Ensure that the query syntax is correct. If the query syntax is incorrect, the query may not return any results.