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

Cross Partition Query Error #4

@abdulkhadar-learning

Description

@abdulkhadar-learning

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();

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions