Skip to content
This repository has been archived by the owner on Oct 8, 2021. It is now read-only.

Cross Partition Query Error #4

Open
abdulkhadar-learning opened this issue Aug 3, 2017 · 0 comments
Open

Cross Partition Query Error #4

abdulkhadar-learning opened this issue Aug 3, 2017 · 0 comments

Comments

@abdulkhadar-learning
Copy link

abdulkhadar-learning commented Aug 3, 2017

Hi Fellows - After downloading and executing the code, if any of you face the following issue apply the resolution as mentioned

Issue: 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

Resolution: Add the parameter EnableCrossPartitionQuery = true to the following lines of code in your solution.
IDocumentQuery query = client.CreateDocumentQuery(
UriFactory.CreateDocumentCollectionUri(DatabaseId, CollectionId),
new FeedOptions { MaxItemCount = -1, EnableCrossPartitionQuery = true })
.Where(predicate)
.AsDocumentQuery();

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant