В Azure DocumentDB при использовании ReplaceDocumentCollectionAsync возникает следующая ошибка:
Microsoft.Azure.Documents.NotFoundException: указано значение ''
для запроса '$ resolFor' неверен., Windows / 10.0.17134
documentdb-netcore-sdk / 1.8.1 в
Microsoft.Azure.Documents.DocumentServiceRequest
Я пытаюсь выполнить IndextTransformation для существующей коллекции, и вот мой код:
var collectionUri = UriFactory.CreateDocumentCollectionUri(_configuration.DatabaseName, _configuration.CollectionName);
_logger.Information("Perform index transformation");
_logger.Information("Create a collection with indexing policy");
var collection = new DocumentCollection { Id = _configuration.CollectionName };
collection.IndexingPolicy.IncludedPaths.Add(new IncludedPath
{
Path = "/*",
Indexes = new Collection<Index> {
new RangeIndex(DataType.String) { Precision = -1 },
new RangeIndex(DataType.Number) { Precision = -1 } }
});
await _client.CreateDocumentCollectionIfNotExists(collection, _configuration.DatabaseName);
_logger.Information("Collection {0} created with index policy \n{1}", collection.Id, collection.IndexingPolicy);
_logger.Information("Change the collection's indexing policy, and then do a replace operation on the collection");
collection.IndexingPolicy.IndexingMode = IndexingMode.Consistent;
await _client.ReplaceDocumentCollectionAsync(collection);
_logger.Information("Check progress and wait for completion - should be instantaneous since we have only a few documents, but larger collections will take time...");
await WaitForIndexTransformation(collection);