azure-cosmosdb

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 =

How do I store a property of IEnumerable<string> in a Cosmos table, with EF Core 3.1

青春壹個敷衍的年華 提交于 2020-12-12 04:01:34
问题 My project is using EF Core 3.1, and targeting Azure Cosmos as the database. I have an entity like this: public class MyEntity { public IEnumerable<string> Names {get;set;} ... other fields } That I would like to end up in a Cosmos document like this: { "Names": ["Name1", "Name2"] } With the entity as is ( IEnumerable<string> ) I get the error: The property 'MyEntity.Names' could not be mapped, because it is of type 'IEnumerable' which is not a supported primitive type or a valid entity type.

Why my CosmosDB Count operation that exceeeds RU Throughput does not throttle?

≡放荡痞女 提交于 2020-12-04 07:09:57
问题 I have a database with a shared Throughput of 400 . This database contains two containers. When I run the following query on one of these containers, I get charged for 1183 RUs : SELECT VALUE COUNT(1) FROM c where c.GroupClaim = 'None' GroupClaim is the partition key of the container. How can a 1183 RUs query do not get rejected/throttled when I have a Throughput set to 400 ? Here is a screen of my query stats : 回答1: I can't explain why your query costs so much but... if you run a query that

Why my CosmosDB Count operation that exceeeds RU Throughput does not throttle?

风格不统一 提交于 2020-12-04 07:09:48
问题 I have a database with a shared Throughput of 400 . This database contains two containers. When I run the following query on one of these containers, I get charged for 1183 RUs : SELECT VALUE COUNT(1) FROM c where c.GroupClaim = 'None' GroupClaim is the partition key of the container. How can a 1183 RUs query do not get rejected/throttled when I have a Throughput set to 400 ? Here is a screen of my query stats : 回答1: I can't explain why your query costs so much but... if you run a query that

Why my CosmosDB Count operation that exceeeds RU Throughput does not throttle?

↘锁芯ラ 提交于 2020-12-04 07:07:54
问题 I have a database with a shared Throughput of 400 . This database contains two containers. When I run the following query on one of these containers, I get charged for 1183 RUs : SELECT VALUE COUNT(1) FROM c where c.GroupClaim = 'None' GroupClaim is the partition key of the container. How can a 1183 RUs query do not get rejected/throttled when I have a Throughput set to 400 ? Here is a screen of my query stats : 回答1: I can't explain why your query costs so much but... if you run a query that