Posts

Showing posts from February, 2024

Cosmos Status Code 400 - SubStatus Code 1004

When calling Cosmos DB via Gateway Mode and you get a HTTP 400 status code, the Cosmos DB Gateway is telling you the request contains invalid data or is missing required parameters.     A sub status code 1004 means that the query is not support cross partition.   Cosmos DB can run partitions (as defined by the partition key) on multiple nodes in the region, however some queries can’t be executed on sperate nodes and then combined in the response.   For example queries with Order By, Top, District, Offset, Limit and Group by require the data from this separate nodes to be evaluated together.   To solve this issue, do the aggregate, ordering and grouping at the client after the data is return.   Or target just a single partition with queries that contain this syntax. {6230289B-5BEE-409e-932A-2F01FA407A92}