0
votes

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

1 Answers

0
votes

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.

enter image description here

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

enter image description here

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