I'm trying to use the BulkExecutor to update properties on documents and I'm getting this error:
System.ArgumentOutOfRangeException: 'Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index'
Here's the code:
var rows = (await GetTableRows(tableId)).ToList(); //documents to work on...
var collection = await Client.ReadDocumentCollectionAsync(CollectionURI);
List<UpdateItem> items = new List<UpdateItem>();
BulkExecutor bulkExecutor = new BulkExecutor(Client, collection);
await bulkExecutor.InitializeAsync();
foreach (var row in rows)
{
List<SetUpdateOperation<int>> rowOperations = new List<SetUpdateOperation<int>>();
rowOperations.Add(new SetUpdateOperation<int>("Order", 0));
items.Add(new UpdateItem(row.Id, "", rowOperations));
}
await bulkExecutor.BulkUpdateAsync(items);
The exception is throw on the last line. Seems pretty straightforward to me. What is going on here ?
The only thing I'm thinking may cause the issue is that I'm working on collection with no partition key (when DocumentDB used to let you do that).
The relevant versions are:
Microsoft.Azure.Documents.Client: 2.1.3.0
Microsoft.Azure.CosmosDB.BulkImport: 1.5.0.0