DocumentDb - Query that expects full results from aggregate functions is not supported

不打扰是莪最后的温柔 提交于 2019-12-25 11:06:41

问题


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

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

This is followed by a GET partition key ranges.

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

Request 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))"}

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

Thanks

Donal


回答1:


Query that expects full results from aggregate functions is not supported

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.

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

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



来源:https://stackoverflow.com/questions/44590614/documentdb-query-that-expects-full-results-from-aggregate-functions-is-not-sup

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!