在针对非分区集合执行以下 cosmos 文档 db sdk 代码时,我得到了“Microsoft.Azure.Documents.Client.FeedResponse”的几乎所有属性,如下所示
但是,在针对分区集合执行以下 cosmos 文档 db sdk 代码时,“Microsoft.Azure.Documents.Client.FeedResponse”的大多数属性返回默认值,如下所示
FeedResponse 对分区和非分区集合的这两种不同行为的任何原因?请说清楚
使用的代码:
var docClient = await _documentClient;
var docDb = await _documentDatabase;
var docCollection = await _documentCollection;
var queryFeed = new FeedOptions()
{
MaxItemCount = -1,
MaxDegreeOfParallelism = -1,
EnableCrossPartitionQuery = true
};
var documentCollectionUri = UriFactory.CreateDocumentCollectionUri(docDb.Id, docCollection.Id);
IDocumentQuery<T> query = docClient.CreateDocumentQuery<T>(documentCollectionUri, queryFeed).AsDocumentQuery();
while (query.HasMoreResults)
{
var feedResponse = await query.ExecuteNextAsync<T>(); //interested in feedResponse.ContentLocation property specifically
result.AddRange(page);
}