Querying documents in multiple partitions
The following lines declare the code for the ListScheduledCompetitions
asynchronous static method, which builds a query to retrieve the titles for all the scheduled competitions that have more than 200 registered competitors and shows them in the console output. In order to retrieve these titles, we must run a cross-partition query because the competitions with more than 200 registered competitors can be at any location; that is, at any ZIP code.
As happened in other samples, there are other ways of achieving the same results. In this case, we use a similar pattern to the one we introduced in the GetCompetitionByTitle
asynchronous static method. Add the following lines to the existing code of the Program.cs
file. The code file for the sample is included in the learning_cosmos_db_04_01
folder in the dot_net_core_2_samples/SampleApp1/SampleApp1/Program.cs
file:
private static async Task ListScheduledCompetitions() { // Retrieve the titles...