You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have migrated a collection, post migration when i am switching to new db endpoints, i am getting an error
Error:Cross partition query is required but disabled. Please set x-ms-documentdb-query-enablecrosspartition to true, specify x-ms-documentdb-partitionkey, or revise your query to avoid this exception., documentdb-dotnet-sdk/2.11.6
sharing old collection setting
new collection setting
The text was updated successfully, but these errors were encountered:
Thank you for reaching out about this issue. By default, when querying a Cosmos DB container using the SDK, cross-partition queries are disabled. This is because you should try and limit executing cross-partition queries as much as possible by ensuring the partition key is included in your queries. While cross-partition queries are sometimes unavoidable and OK, excessive querying across partitions comes with a high cost (in RU/s and performance).
What you need to do in your application code that is making the call to your new container is to update the FeedOptions to enable cross-partition queries with the EnableCrossPartitionQuery property. Here's an example:
var queryable = client.CreateDocumentQuery<Book>(
collectionLink, new FeedOptions { EnableCrossPartitionQuery = true }).Where(b => b.Price > 1000);
One of our customers mentioned the query was working fine for them without adding crosspartitionquery for their old account .But on the new account with exact same configuration it is giving this error .Was there a change implemented which worked for old accounts and stopped working off late ?
I have migrated a collection, post migration when i am switching to new db endpoints, i am getting an error
Error:Cross partition query is required but disabled. Please set x-ms-documentdb-query-enablecrosspartition to true, specify x-ms-documentdb-partitionkey, or revise your query to avoid this exception., documentdb-dotnet-sdk/2.11.6
sharing old collection setting
new collection setting
The text was updated successfully, but these errors were encountered: