azure-cosmosdb-sqlapi

Cosmos DB : cross partition query can not be directly served by the gateway

谁说我不能喝 提交于 2021-01-28 00:10:33
问题 Any idea why when I execute the query below in Cosmos DB using the rest api I get the error below? The same query without the order by works fine... I have set the header "x-ms-documentdb-query-enablecrosspartition: True" in both cases and I am using PHP to make the requests. MULTI PARTITION QUERY THAT WORKS: SELECT c.id, c.name, c.age FROM c where c.age = 30 MULTI PARTITION QUERY WITH ERROR: SELECT c.id, c.name, c.age FROM c where c.age = 30 order by c.age asc ERROR: Client error: POST https

Cosmos DB Array Query Doesn't Work in .NET SDK

放肆的年华 提交于 2021-01-27 19:03:34
问题 I'm attempting to get all distinct category values used in a container, where categories is an array of strings. Looking at the Cosmos DB SQL docs, I've constructed the following query which works in the Emulator when I execute the SQL and returns an array of distinct categories as expected. SELECT DISTINCT * FROM c IN s.categories Results in [ "Running", "Rugby", "Icon" ] However, if I use the same query via the Cosmos .NET SDK I get an error "Identifier 'session' could not be resolved." Why

Azure cosmos Db when create a new document -> One or more errors occurred [closed]

风流意气都作罢 提交于 2020-12-27 06:02:33
问题 Closed . This question needs details or clarity. It is not currently accepting answers. Want to improve this question? Add details and clarify the problem by editing this post. Closed 2 days ago . Improve this question I use SQL Api from azure cosmos and since yesterday I have this type of error. Sometimes this error comes back to me ... what can it be related to? Can it be related to this metric situation? I increased the RU / s so that I have enough for each physical partition. But I always

Azure cosmos Db when create a new document -> One or more errors occurred [closed]

眉间皱痕 提交于 2020-12-27 06:01:45
问题 Closed . This question needs details or clarity. It is not currently accepting answers. Want to improve this question? Add details and clarify the problem by editing this post. Closed 2 days ago . Improve this question I use SQL Api from azure cosmos and since yesterday I have this type of error. Sometimes this error comes back to me ... what can it be related to? Can it be related to this metric situation? I increased the RU / s so that I have enough for each physical partition. But I always

How to access partition key from an existing table in cosmos db

放肆的年华 提交于 2020-12-15 09:38:08
问题 I'm trying to access only partition key of an existing collection in cosmos db I have gone through official doc and git hub links but no luck. Please help me. Note: I'm able to successfully read and write data using java by using Document Client(SQL api) 回答1: Please try this code: DocumentClient dClient = new DocumentClient(endPoint,primary_key,null,null); String collectionLink = String.format("/dbs/%s/colls/%s", databaseId, collectionId); ResourceResponse<DocumentCollection> response =

How to access partition key from an existing table in cosmos db

北城余情 提交于 2020-12-15 09:34:15
问题 I'm trying to access only partition key of an existing collection in cosmos db I have gone through official doc and git hub links but no luck. Please help me. Note: I'm able to successfully read and write data using java by using Document Client(SQL api) 回答1: Please try this code: DocumentClient dClient = new DocumentClient(endPoint,primary_key,null,null); String collectionLink = String.format("/dbs/%s/colls/%s", databaseId, collectionId); ResourceResponse<DocumentCollection> response =

The connection string is missing a required property: AccountEndpoint error while using the new CosmosClient(CosmosConnectionString)

雨燕双飞 提交于 2020-08-10 19:21:50
问题 I am getting The connection string is missing a required property: AccountEndpoint error while using the new CosmosClient(CosmosConnectionString) constructor for CosmosClient with assembly Microsoft.Azure.Cosmos.Client, Version=3.11.0.0 - How to fix it? The connection string from the account looks like (AccountEndpoint is missing: DefaultEndpointsProtocol=https;AccountName=devdb;AccountKey=xxxx;TableEndpoint=https://devdb.table.cosmos.azure.com:443/; 回答1: The connection string you're