问题
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