azure-cosmosdb-sqlapi

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

╄→尐↘猪︶ㄣ 提交于 2020-08-10 19:20:24
问题 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

Selecting values from objects in document nested array in CosmosDB

﹥>﹥吖頭↗ 提交于 2020-08-07 05:18:26
问题 Imagine we have a such collection (example taken from https://www.documentdb.com/sql/demo) { "_id" : "19015", "description" : "Snacks, granola bars, hard, plain", "servings" : [ { "amount" : 1, "description" : "bar", "weightInGrams" : 21 }, { "amount" : 1, "description" : "bar (1 oz)", "weightInGrams" : 28 }, { "amount" : 1, "description" : "bar", "weightInGrams" : 25 } ] } How i can query CosmosDB in SQL api to get results such like this? { "_id" : "19015", "servings" : [ { "description" :

What are storage differences between Cosmosdb sql api and Cosmosdb cassandra api

自闭症网瘾萝莉.ら 提交于 2020-07-10 07:57:30
问题 It is mentioned in most of the articles that if we are using Cosmos Db and newly creating our app we should go with Cosmos db sql api . Mongo api and cassandra api can be used when u already have your app integrated with actual mongo and cassandra and we want to migrate quickly to cosmosdb and not change the ecosystem. But when we create a new cluster of cosmosdb in azure it ask for api type. That means internally there must be some storage differences and internal engine processing

Why is cosmos db creating 5 partitions for a same partition key value?

♀尐吖头ヾ 提交于 2020-07-09 15:03:24
问题 We are using Cosmos DB SQL API and here's a collection XYZ with: Size: Unlimited Throughput: 50000 RU/s PartitionKey: Hashed We are inserting 200,000 records each of size ~2.1 KB and having same value for a partition key column. Per our knowledge all the docs with same partition key value are stored in the same logical partition, and a logical partition should not exceed 10 GB limit whether we are on fixed or unlimited sized collection. Clearly our total data is not even 0.5 GB. However, in

Is there support for paging with OData in Cosmos DB?

爱⌒轻易说出口 提交于 2020-07-03 05:21:09
问题 I can see there is support for offset/limit when accessing a Cosmos DB in Azure via the SQL API - but does OData support this yet? 回答1: UPDATE You can download my demo in github. And this article and offical document can help u. Data in My Storage account Test by postman TestDataController.cs public class TestDataController : ODataController { [EnableQuery] public IHttpActionResult Get() { CloudStorageAccount account = CloudStorageAccount.Parse("DefaultEndpointsProtocol=***x=core.windows.net"

How does CosmosDb charge RUs for write operations in a multi-master enironment?

廉价感情. 提交于 2020-06-17 01:52:31
问题 Multi-Master Database with single region: SDK reports ~10 RU to perform a write operation Multi-Master Database with 5 regions: : SDK reports ~46.86 RU for the same operation (~5x to incorporate replication to all regions. Makes sense) If you have a collection provisioned at 10k RU, does cosmos provision 10k RU for every region? The microsoft docs would suggest so but then the SDK reports all region cost when writing to the local region as above which seems a bit odd / confusing? Additionally

How can I use LINQ in CosmosDB SDK v3.0 async query?

筅森魡賤 提交于 2020-05-12 19:52:22
问题 I've been following the official documentation here: https://docs.microsoft.com/en-us/azure/cosmos-db/sql-api-get-started#Query But I can't figure out how to correctly use a LINQ expression instead on an SQL string. I experimented with GetItemLinqQueryable, but I don't know if is the right way to use it. Also is not async. var db = Client.GetDatabase(databaseId); var container = db.GetContainer(containerId); var q = container.GetItemLinqQueryable<Person>(); var result = q.Where(p => p.Name ==

How can I use LINQ in CosmosDB SDK v3.0 async query?

烂漫一生 提交于 2020-05-12 19:42:58
问题 I've been following the official documentation here: https://docs.microsoft.com/en-us/azure/cosmos-db/sql-api-get-started#Query But I can't figure out how to correctly use a LINQ expression instead on an SQL string. I experimented with GetItemLinqQueryable, but I don't know if is the right way to use it. Also is not async. var db = Client.GetDatabase(databaseId); var container = db.GetContainer(containerId); var q = container.GetItemLinqQueryable<Person>(); var result = q.Where(p => p.Name ==

How can I use LINQ in CosmosDB SDK v3.0 async query?

自古美人都是妖i 提交于 2020-05-12 19:42:22
问题 I've been following the official documentation here: https://docs.microsoft.com/en-us/azure/cosmos-db/sql-api-get-started#Query But I can't figure out how to correctly use a LINQ expression instead on an SQL string. I experimented with GetItemLinqQueryable, but I don't know if is the right way to use it. Also is not async. var db = Client.GetDatabase(databaseId); var container = db.GetContainer(containerId); var q = container.GetItemLinqQueryable<Person>(); var result = q.Where(p => p.Name ==

CosmosDB + group by

余生颓废 提交于 2020-05-08 20:00:47
问题 I need to use " GROUP BY " clause on Azure Data Explorer but I think it is unsupported . Someone have any idea to solve or avoid group by? Best regards, 回答1: Finally, Azure Cosmos DB currently supports GROUP BY in .NET SDK 3.3 or later. Support for other language SDK's and the Azure Portal is not currently available but is planned. <group_by_clause> ::= GROUP BY <scalar_expression_list> <scalar_expression_list> ::= <scalar_expression> | <scalar_expression_list>, <scalar_expression> 回答2: There