From 7032f67b8a74d0c34058382b7c8fd41260bbd588 Mon Sep 17 00:00:00 2001 From: Coderrob Date: Sun, 1 Dec 2019 16:59:47 -0600 Subject: [PATCH] Enable cross-partition querying. --- src/CourseTodo.Api/GetTodos.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/CourseTodo.Api/GetTodos.cs b/src/CourseTodo.Api/GetTodos.cs index bf73497..e0addfb 100644 --- a/src/CourseTodo.Api/GetTodos.cs +++ b/src/CourseTodo.Api/GetTodos.cs @@ -28,7 +28,8 @@ public static HttpResponseMessage Run( using var client = DocumentDbClient.GetClient(); - var results = client.CreateDocumentQuery(collectionLink, query).ToList(); + var feedOptions = new FeedOptions { EnableCrossPartitionQuery = true }; + var results = client.CreateDocumentQuery(collectionLink, query, feedOptions).ToList(); return req.CreateResponse(HttpStatusCode.OK, results); }