azure-cosmosdb

Is there a way to insert a document with a nested array in Azure Data Factory?

社会主义新天地 提交于 2019-12-11 02:07:29
问题 I am trying to add documents in CosmosDb that has a nested array. I am using the Copy Activity . Sample Document: { "itemNumber": "D10001", "readings" : [ { "value": 25, "ets":"100011111"}, { "value": 35, "ets":"100011122"} ] } In the source dataset I formatted the readings array as a string in my SQL query, and set the data type in the sink dataset as an Object . The data is copied, but the readings are stringified. Is there a means to configure the Copy Activity to handle this array? 回答1:

Azure Cosmos DB check if array in field is contained in search array

帅比萌擦擦* 提交于 2019-12-11 01:48:10
问题 I have an Microsoft Azure CosmosDB MongoDB Api database and I am trying to get all the documents where one array field is fully contained in my search array. So, what I am looking for is, given the collection test containing the documents: {"id":1,"filters":[1,2]} {"id":2,"filters":[1,3]} if I execute: db.test.find({"filters":{"$elemMatch":{$nin: [1,3]}}}) I get back: {"id":1,"filters":[1,2]} However, if I negate it, since I want all the documents with filters fully contained in my search,

Delete SQL for CosmosDB [duplicate]

末鹿安然 提交于 2019-12-11 01:22:39
问题 This question already has answers here : Cosmos DB - Deleting a document (3 answers) Closed last year . Is it possible to delete from a document collection using SQL in CosmosDB? I am looking for a Delete SQL similar to SELECT as below: SELECT * FROM Families f WHERE f.id = "AndersenFamily" I am looking for something: SELECT * FROM Families f WHERE f.id = "AndersenFamily" 回答1: Is it possible to delete from a document collection using SQL in CosmosDB? As of today it is not possible to do so.

How to import documents that have arrays with the Cosmos DB Data Migration Tool

心已入冬 提交于 2019-12-11 01:18:10
问题 I'm trying to import documents from a SQL Server database. Each document will have a list of products that a customer has bought, for example: { "name": "John Smith" "products": [ { "name": "Pencil Sharpener" "description": "Something, this and that." }, { "name": "Pencil case" "description": "A case for pencils." } ] } In the SQL Server database, the customer and products are stored in separate tables with a one-to-many relationship between the customer and products: Customer Id INT Name

In Azure DocumentDB, how can I get a list of all properties in a collection?

假装没事ソ 提交于 2019-12-11 00:37:42
问题 I would like to be able to provide a list of all the properties across all documents in a collection. The best way I can come up with is to query for all documents and then build the list in the client, but this feels wrong. 回答1: The only way to do what you want is to read all of the documents. However, if you are worried about bandwidth, then you can do it in a stored procedure that only returns the list of properties. If you take that route, I recommend that you start with the

Get All documents in a Collection CosmosDb

五迷三道 提交于 2019-12-11 00:37:05
问题 I would like to return all documents in a collection for CosmosDb My code is as follows client.CreateDocumentQuery(UriFactory.CreateDocumentUri(dbName, colName,"id")).ToList(); It is not working. I can find a specific document but not all Thanks 回答1: UriFactory.CreateDocumentUri creates a Uri for a document specific query. What you want is all documents in a collection so what you need to create is to create a collection Uri. You can do that by using UriFactory.CreateDocumentCollectionUri

Reducing Provisioned Throughput for CosmosDB

十年热恋 提交于 2019-12-11 00:15:15
问题 I have a cosmosDB that had 4 containers and 400RUs provisioned at the database level. I added 2 containers and without warning the provisioned RUs was increased to 600. The document below explains why this happened. Each container above the 4th requires a minimum extra 100RUs. I have tight budget restrictions so I deleted 2 containers but I could not find a way to reduce the minimum provisioned throughput as the dropdown for provisioning throughput only allows increases. Is there a way to

Azure DocumentDb “high water mark”/timestamp

雨燕双飞 提交于 2019-12-10 22:58:37
问题 I'm looking to implement a process that will occasionally pull all "new" records from a DocumentDb, where new is "all documents added or modified since the last time the process was run." SQL Server has rowversion for this, which is guaranteed unique and monotonically increasing across all rows and columns in a database. I see DocumentDb has _ts, which (according to the documentation) used as a high water mark for Azure Search indexing, but how does that work? If multiple documents are

What happens when 5 second execution time limit exceeds in Azure DocumentDb Stored Procedures

家住魔仙堡 提交于 2019-12-10 22:51:43
问题 I have a read operation that reads a lot of records from a DocumentDb collection and when executed it will run for a long time. I am writing a stored procedure to move that query to the server-side. I understand that documentdb stored procedures have a execution cap of 5 seconds. What i wanna know is that in a read operation what happens when the query execution hits that time limit. Can i add some kind of a retry logic to continue after some time or will i have to do the read from the

self-join on documentdb syntax error

妖精的绣舞 提交于 2019-12-10 21:44:12
问题 I'm having trouble doing an otherwise SQL valid self-join query on documentdb. So the following query works: SELECT * FROM c AS c1 WHERE c1.obj="car" But this simple self join query does not: SELECT c1.url FROM c AS c1 JOIN c AS c2 WHERE c1.obj="car" AND c2.obj="person" AND c1.url = c2.url , with the error, Identifier 'c' could not be resolved . It seems that documendb supports self-joins within the document, but I'm asking on the collection level. I looked at the official syntax doc and