azure-cosmosdb-sqlapi

Cosmos Db Throughput

为君一笑 提交于 2019-12-01 21:38:05
Is there any option to retrieve Cosmos DB (SQL API) throughput programmatically. I'm using the below code to get the list of DB DocumentClient client = new DocumentClient(ClientURL, ClientKey,); var databaseList = client.CreateDatabaseQuery().ToList(); Next I wanted to know the throughput for each of the database. Please let me know if this is feasible You could refer to CreateOfferQuery method to get throughout settings of Database or Collections. Also,please refer to this rest api: https://docs.microsoft.com/en-us/rest/api/cosmos-db/get-an-offer 来源: https://stackoverflow.com/questions

Use Linq.Any() inside a Linq.Where() on CosmosDb

南楼画角 提交于 2019-11-30 23:12:51
I am trying to nest an .Any() inside a .Where() clause to query a local CosmosDb emulator. The code looks like below; where permittedStundentIds is a variable ( List<long> ) and a is a Document within the CosmosDb .Where(a => permittedStudentIds.Any(sId => a.Students.Any(s => s.Id == sId))); When I execute the query, I get the error: Method 'Any' is not supported. ActivityId: 800000a8-0002-d600-b63f-84710c7967bb, documentdb-dotnet-sdk/1.22.0 Host/64-bit MicrosoftWindowsNT/10.0.16299.0 I have tried multiple variations to get an equivalent expression, but to no avail. The only one that worked

Use Linq.Any() inside a Linq.Where() on CosmosDb

谁都会走 提交于 2019-11-30 18:15:56
问题 I am trying to nest an .Any() inside a .Where() clause to query a local CosmosDb emulator. The code looks like below; where permittedStundentIds is a variable ( List<long> ) and a is a Document within the CosmosDb .Where(a => permittedStudentIds.Any(sId => a.Students.Any(s => s.Id == sId))); When I execute the query, I get the error: Method 'Any' is not supported. ActivityId: 800000a8-0002-d600-b63f-84710c7967bb, documentdb-dotnet-sdk/1.22.0 Host/64-bit MicrosoftWindowsNT/10.0.16299.0 I have

How to find duplicates in a nested array in cosmos db without GROUP BY and COUNT

佐手、 提交于 2019-11-29 16:24:46
I am trying to find duplicates in a nested object in a collection. In ye olde SQL, I would do this with some sort of GROUP BY and a COUNT. Cosmos DB doesn't support GROUP BY (as far as I can see) so I am trying to find a work around. One limitation is that I only have access to the data explorer in the azure portal (Don't ask). To explain in more detail, suppose you have a collection like the following. Note that the first item has a duplicate in the "stuff" collection: [ { "id": "1", "Name": "Item with duplicate stuff", "stuff" : [ { "name" : "A", }, { "name" : "B", }, { "name" : "A" } ] }, {