azure-cosmosdb

Indexing arrays in CosmosDB

和自甴很熟 提交于 2019-12-22 05:07:18
问题 Why doesn't CosmosDB index arrays by default? The default index path is "path": "/*" Doesn't that mean "index everything"? Not "index everything except arrays". If I add my array field to the index with something like this: "path": "/tags/[]/?" It will work and start indexing that particular array field. But my question is why doesn't "index everything" index everything? EDIT: Here's a blog post that describes the behavior I'm seeing. http://www.devwithadam.com/2017/08/querying-for-items-in

Indexing arrays in CosmosDB

别来无恙 提交于 2019-12-22 05:07:02
问题 Why doesn't CosmosDB index arrays by default? The default index path is "path": "/*" Doesn't that mean "index everything"? Not "index everything except arrays". If I add my array field to the index with something like this: "path": "/tags/[]/?" It will work and start indexing that particular array field. But my question is why doesn't "index everything" index everything? EDIT: Here's a blog post that describes the behavior I'm seeing. http://www.devwithadam.com/2017/08/querying-for-items-in

How to cast Azure DocumentDB Document class to my POCO class?

岁酱吖の 提交于 2019-12-22 04:46:08
问题 Is there a way to cast the Microsoft.Azure.Documents.Document object to my class type? I've written an Azure Function class, with a CosmosDBTrigger . The trigger receives an array of Microsoft.Azure.Documents.Document . I like having that Document class so that I can access the meta data about the record itself, but I also would like to interact with my data from my class type in a static way. I see the JSON representation of my data when I call ToString . Should I manually convert that JSON

DocumentDB client lifetime

孤街浪徒 提交于 2019-12-22 04:38:18
问题 To access DocumentDB/CosmosDB I'm using package Microsoft.Azure.DocumentDB.Core (v1.3.2). I have noticed when I create and initialise DocumentClient class: var documentClient = new DocumentClient(new Uri(endpointUrl), primaryKey); await documentClient.OpenAsync(); There is a number of requests fired to the endpoint to get information about indexes and other information. To be exact there are 9 HTTP requests going out on .OpenAsync() . This makes the creation and activation of the client a

CosmosDB emulator can't start since port is already in use

坚强是说给别人听的谎言 提交于 2019-12-22 04:04:22
问题 I'm giving CosmosDB a chance and so I decided to build an app that uses it, but I'm running into this issue when using the emulator: Port is already in use. I'm not sure where to reconfigure the port the emulator is pointing. 回答1: You can use /Port option to configure the emulator to listen to a different port. https://docs.microsoft.com/en-us/azure/cosmos-db/local-emulator#a-idcommand-lineacommand-line-tool-reference 回答2: I had a similar problem, where i got an error "port 10253 already in

How to get a subgraph consisting of all vertices, that satisfy specific condition

妖精的绣舞 提交于 2019-12-21 21:24:51
问题 The Document and the Revision are two objects that reside in our domain logic specific layer. The Document represents an abstraction around any material piece of paper that you could think of. That is - every contract, invoice or drawing could be called a Document . On the other hand, the material representation of the Document is the Revision : the list of paper, that construction engineer receives on site, represents a Revision of the Document that designer has created. If something in a

DocumentDb GUID Index Precision

跟風遠走 提交于 2019-12-21 20:29:49
问题 Let's say we have a non-unique GUID/UUID value in our documents: [ { "id": "123456", "Key": "117dfd49-a71d-413b-a9b1-841e88db06e8" "Name": "Kaapstad", }, ... ] We want to query upon this through equality only. No range or orderby querying required. E.g: SELECT * FROM c where c.Key = "117dfd49-a71d-413b-a9b1-841e88db06e8" Below is the index definition. It's a hash index (since no range querying will be performed) using a String data type (since Javascript doesn't support Guid natively)

DocumentDb GUID Index Precision

你。 提交于 2019-12-21 20:29:12
问题 Let's say we have a non-unique GUID/UUID value in our documents: [ { "id": "123456", "Key": "117dfd49-a71d-413b-a9b1-841e88db06e8" "Name": "Kaapstad", }, ... ] We want to query upon this through equality only. No range or orderby querying required. E.g: SELECT * FROM c where c.Key = "117dfd49-a71d-413b-a9b1-841e88db06e8" Below is the index definition. It's a hash index (since no range querying will be performed) using a String data type (since Javascript doesn't support Guid natively)

Unable to cast object of type 'System.Linq.EnumerableQuery to type 'Microsoft.Azure.Documents.Linq.IDocumentQuery

ε祈祈猫儿з 提交于 2019-12-21 17:55:12
问题 I have a class with the following Method and am using Moq as a Unit Testing Framework. How can I mock the following: FeedOptions feedOptions = new FeedOptions { MaxItemCount = 1000 }; var query = await _storeAccessClient.CreateDocumentQueryAsync<CustomEntity>(_collectionLink, feedOptions) .Where(c => c.DataType == _dataType) .OrderBy(c => c.StartTime, sortOrder) .AsDocumentQuery() .ExecuteNextAsync<CustomEntity>(); List<CustomEntity> result = query.ToList<CustomEntity>(); Any Help is greatly

Why am I seeing different index behaviour between 2 seemingly identical CosmosDb Collections

ε祈祈猫儿з 提交于 2019-12-21 16:22:15
问题 I'm trying to debug a very strange discrepency between 2 seperate cosmos db collection that on face value are configured the same. We recently modified some code that executed the following query. OLD QUERY SELECT * FROM c WHERE c.ProductId = "CODE" AND c.PartitionKey = "Manufacturer-GUID" NEW QUERY SELECT * FROM c WHERE (c.ProductId = "CODE" OR ARRAY_CONTAINS(c.ProductIdentifiers, "CODE")) AND c.PartitionKey = "Manufacturer-GUID" The introduction of that Array_Contains call in the production