azure-cosmosdb-sqlapi

Query CosmosDb Unstructured JSON

假如想象 提交于 2020-01-15 05:13:29
问题 How can CosmosDB Query the values of the properties within a dynamic JSON? The app allows storing a JSON as a set of custom properties for an object. They are serialized and stored in CosmosDb. For example, here are two entries: { "id": "ade9f2d6-fff6-4993-8473-a2af40f071f4", ... "Properties": { "fn": "Ernest", "ln": "Hemingway", "a_book": "The Old Man and the Sea" }, ... } and { "id": "23cb9d4c-da56-40ec-9fbe-7f5178a92a4f", ... "Properties": { "First Name": "Salvador", "Last Name": "Dali",

Query CosmosDb Unstructured JSON

偶尔善良 提交于 2020-01-15 05:13:10
问题 How can CosmosDB Query the values of the properties within a dynamic JSON? The app allows storing a JSON as a set of custom properties for an object. They are serialized and stored in CosmosDb. For example, here are two entries: { "id": "ade9f2d6-fff6-4993-8473-a2af40f071f4", ... "Properties": { "fn": "Ernest", "ln": "Hemingway", "a_book": "The Old Man and the Sea" }, ... } and { "id": "23cb9d4c-da56-40ec-9fbe-7f5178a92a4f", ... "Properties": { "First Name": "Salvador", "Last Name": "Dali",

Cosmos DB - Indexing Policy Settings

故事扮演 提交于 2020-01-06 08:13:02
问题 I am using the azure cli in order to set my indexing policy. I am using the following JSON: { "indexingMode": "consistent", "automatic": true, "includedPaths": [ { "path": "/ttl/?", "indexes": [ { "kind": "Range", "dataType": "Number", "precision": -1 } ] } ], "excludedPaths": [ { "path": "/*" } ] } The script reports no errors have occurred, however when I log into the portal and look at the indexing policy, it shows the following: { "indexingMode": "consistent", "automatic": true,

Change Feed in multi-region Azure Cosmos DB

穿精又带淫゛_ 提交于 2020-01-03 04:51:14
问题 I am using Cosmos DB multi-region (single region write) account. Currently it is enabled in East US and West US. The write region is West US. The Change Feed listeners are deployed in both East US and West US. I wanted to understand, if I can specify that the listeners deployed in East US reads Change Feed from East US and listeners in West US reads Change Feed from West US. Or all the listeners will always read Change Feed from write region? 回答1: You can certainly make your listeners read

The remote server returned an error: (400) Bad Request. At C:\Program Files\WindowsPowerShell\Modules\CosmosDB\3.1.0.293\CosmosDB.psm1

巧了我就是萌 提交于 2019-12-25 02:53:54
问题 I have a PowerShell script for creating database and collection inside Azure Cosmos DB. I am trying to insert some dummy records inside collection by using the below PowerShell script. #region Parameters $clientId= "XXXXXXXXXXXXXXX" $clientSecret= "XXXXXXXXXXXX=" $subscriptionName= "XXXXXXXXXXXXXXX" $tenantId= "XXXXXXXXXXXXXXXX" $resourceGroupName= "Demo" $connectionString='XXXXXXXXXXXXXXXXx==' $cosmosDBAccounts= @('demo-account-01') $databaseName='demo-db-01' $collectionName='demo-collection

Cosmos DB partitioned access to a database

偶尔善良 提交于 2019-12-25 00:39:27
问题 I am implementing a multi-tenant application using cosmosDB. I am using partition keys to separate multiple users data. Following best practices i am trying to allow each tenant to have its own db access token. I create a user and permission and use the created token to access the partition. But I get the following error: Partition key provided either doesn't correspond to definition in the collection or doesn't match partition key field values specified in the document. ActivityId: 1659037a

Check the content of an array — CosmosDB

…衆ロ難τιáo~ 提交于 2019-12-25 00:10:03
问题 I query a CosmosDB database using the following query : SELECT c.EventType.EndDeviceEventDetail FROM c WHERE (c.EventType.EndDeviceEventType.eventOrAction = '93' AND c.EventType.EndDeviceEventType.subdomain = '137' AND c.EventType.EndDeviceEventType.domain = '26' AND c.EventType.EndDeviceEventType.type = '3') I get as a response [ { "EndDeviceEventDetail": [ { "name": "Spontaneous", "value": "true" }, { "name": "DetectionActive", "value": "true" }, { "name": "RCDSwitchReleased", "value":

Delete documents from Azure cosmos DB collection with multiple Partition Keys

╄→尐↘猪︶ㄣ 提交于 2019-12-24 22:17:09
问题 I have to delete some documents from azure cosmos DB through azure portal. I wrote a stored procedure in container which will delete the data which has to be deleted. But at the time of execution of stored procedure it will ask for partition key value. I have to delete documents which are having different partition keys. Below given is the Stored Procedure Used. function bulkDeleteProcedure(deletedate) { var collection = getContext().getCollection(); var collectionLink = collection

CosmosDB - SubDocument Delselecting - LINQ Query

不羁的心 提交于 2019-12-24 21:54:35
问题 I have a ProductDocument model in CosmosDB, which represents a Product. Within that model there is a subdocument contributors which holds who has contributed to the Product. Each contributor has a role . Now I have been experimenting with a query that needs to: Only select ProductDocument with a contributor.roleDescription of Author Only select ProductDocument with a division of Pub 1 Only include contributors sub documents with a contributor.roleDescription of Author in the result set. Now I

PartitionKey value must be supplied for this operation

◇◆丶佛笑我妖孽 提交于 2019-12-23 17:17:56
问题 I am trying to retrieve a document from the Azure Cosmos Db Collection. I am running into an error Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed; nested exception is java.lang.UnsupportedOperationException: PartitionKey value must be supplied for this operation.] with root cause java.lang.UnsupportedOperationException: PartitionKey value must be supplied for this operation. I was trying to look up online how can I provide