-1

I am querying a CosmosDB with a huge list of ids, and i get an exception saying i have exceeded the permissible limit of 256 characters.

What is the best way to handle such huge queries ?

The only way i can think of is to split the list and execute in batches.

Any other suggestions ?

user1354825
  • 1,108
  • 4
  • 21
  • 54

1 Answers1

1

If you're querying data this way then your model is likely not optimal. I would look to remodel your data such that you can query on another property shared by the items you are looking for (in partition as well too).

Note that this could also be achieved by using Change Feed to copy the data into another container with a different partition key and a new property that groups the data together. whether you do this will depend on how often you run this query and whether this is cheaper than running this query in multiple batches.

Mark Brown
  • 8,113
  • 2
  • 17
  • 21