本文介绍了DocumentDb-不希望从聚合函数获得完整结果的查询的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我对DocumentDb发出linq计数时.第一个POST网络请求导致一个400错误的请求

When I issue a linq count against DocumentDb.The first POST web request results in a 400 Bad request

请求json:

{"query":"SELECT VALUE Count(1) FROM root 
    WHERE ((((root[\"docType\"] = \"Whatever\") 
    AND (root[\"field1\"] = false)) 
    AND (root[\"field2\"] = true)) 
    AND (root[\"field3\"] = 1)) "}

消息: 不支持期望聚合函数提供完整结果的查询

Message: Query that expects full results from aggregate functions is not supported

其后是GET分区键范围.

This is followed by a GET partition key ranges.

然后另一个对计数查询有效的POST网络请求:

Then another POST web request for the count query which works:

请求json:

{"query":"SELECT VALUE [{\"item\": Count(1)}]\r\nFROM root\r\n
    WHERE ((((root[\"docType\"] = \"Whatever\") 
    AND (root[\"field1\"] = false)) 
    AND (root[\"field2\"] = true)) 
    AND (root[\"field3\"] = 1))"}

我在这里做错什么吗?还是对documentDb预期的行为?

Am I doing something wrong/silly here or is this expected behaviour for documentDb.

谢谢

Donal

推荐答案

我进行了测试,并且出现相同的错误" 查询不支持期望聚合函数提供完整结果的查询 ".如果x-ms-documentdb-query-iscontinuationexpected请求标头设置为false,则会出现在我的身边.

I do a test and same error "Query that expects full results from aggregate functions is not supported" appears on my side if x-ms-documentdb-query-iscontinuationexpected request header is set to false.

x-ms-documentdb-query-iscontinuationexpected请求标头设置为True,并且请求 确定 .

Set x-ms-documentdb-query-iscontinuationexpected request header to True, and request is ok.

请捕获您的请求,并检查x-ms-documentdb-query-iscontinuationexpected请求标头的实际值.

Please capture your request and check the actual value of x-ms-documentdb-query-iscontinuationexpected request header.

这篇关于DocumentDb-不希望从聚合函数获得完整结果的查询的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-24 07:20