azure-cosmosdb

Differentiate between partition keys & partition key ranges in Azure Cosmos DB

青春壹個敷衍的年華 提交于 2020-01-22 00:19:12
问题 I'm having difficulty understanding the difference between the partition keys & the partition key ranges in Cosmos DB. I understand generally that a partition key in cosmos db is a JSON property/path within each document that is used to evenly distribute data among multiple partitions to avoid any uneven "hot partitions" -- and partition key decides the physical placement of documents. But its not clear to me how what the partition key range is...is this just a range of literal partition keys

SQLInjection against CosmosDB in an Azure function

大城市里の小女人 提交于 2020-01-21 11:35:32
问题 I have implemented an Azure function that is triggered by a HttpRequest. A parameter called name is passed as part of the HttpRequest. In Integration section, I have used the following query to retrieve data from CosmosDB (as an input): SELECT * FROM c.my_collection pm WHERE Contains(pm.first_name,{name}) As you see I am sending the 'name' without sanitizing it. Is there any SQLInjection concern here? I searched and noticed that parameterization is available but that is not something I can do

what is the supported Model for multi-level Document search?

喜你入骨 提交于 2020-01-17 13:46:13
问题 I have created few documents in DocumentDb and i am looking for how to search multi-level or parent child objects in single document using Azure search services. can you any one help me out/any links. 回答1: Azure Search requires documents to be flattened, so what you will need to do is create a query in DocumentDB to help you do this. To get started, there is a document here, that will give you some information on how to model these more complex data types in Azure Search. Also, I prefer to do

Unable to Execute procedure with multiple parameters

久未见 提交于 2020-01-17 06:53:56
问题 i am trying to work with Azure's DocumentDb to validate the user credentials for login but i am not able to get the proper result. Some Points: 1. this is a partitioned collection and i am passing the partition key. 2. i am passing an array as parameter. Here is my Code for calling the procedure: response = await client.ExecuteStoredProcedureAsync<string>(storedProcedurelink, new RequestOptions { PartitionKey = new PartitionKey(partitionKey) }, new dynamic[]{param}); and here is my code for

DocumentDB: ST_DISTANCE function does not work with '<' (smaller than) sign

余生长醉 提交于 2020-01-17 04:11:27
问题 I have a perfectly working query that looks as follows: SELECT p.id FROM place p WHERE ST_DISTANCE(p.geometry, {'type': 'Point', 'coordinates':[52.0826443333333, 5.11771783333333]} ) > 6000 It returns a list of id's of documents that are more than 6000 m from the geospatial point. Everything seems fine. However, if I turn around the '>' (greater than) sign to '<' (smaller than), it does not give any result. Interestingly, it does return false/true statements if I put the WHERE clause in a

DocumentDB show all documents of specific entity type

被刻印的时光 ゝ 提交于 2020-01-16 20:25:13
问题 I have a generic IDocumentDbRepository repository for providing basic CRUD operations with DocumentDB and specific repositories for additional operations with specific entities, which inherits or implements this interface and class. public interface IDocumentDbRepository<T> where T : class { //IEnumerable<T> GetItems(); Task<IEnumerable<T>> GetItemsAsync(); Task<T> GetItemAsync(T id); Task<T> AddDocumentAsync(T item); Task<T> UpdateDocumentAsync(T id, T item); Task DeletedocumentAsync(T id);

How to generate a custom JSON output from a CosmosDB Graph using Gremlin?

霸气de小男生 提交于 2020-01-16 19:08:10
问题 I'm using the CosmosDB Graph database to store the names of a few people, their marriages and the children whom they have out of the marriages. In the following diagram, you will see that the person Husband has a Child A from his first marriage and Child B from his second marriage. Father of Husband Mother of Husband GRAND FATHER & GRAND MOTHER +---------------+--------------+ Marriage | +------------+---------------+--------------+-----------+ FATHER & MOTHER Ex Wife A Marriage Husband

How to generate a custom JSON output from a CosmosDB Graph using Gremlin?

二次信任 提交于 2020-01-16 19:08:08
问题 I'm using the CosmosDB Graph database to store the names of a few people, their marriages and the children whom they have out of the marriages. In the following diagram, you will see that the person Husband has a Child A from his first marriage and Child B from his second marriage. Father of Husband Mother of Husband GRAND FATHER & GRAND MOTHER +---------------+--------------+ Marriage | +------------+---------------+--------------+-----------+ FATHER & MOTHER Ex Wife A Marriage Husband

Error CS0006: Metadata file 'MongoDB' could not be found

♀尐吖头ヾ 提交于 2020-01-16 14:10:15
问题 I have created a Azure Function and it has below code in `run.csx' using System; using System.Runtime.Serialization; using System.ServiceModel.Description; using MongoDB.Bson.IO; using MongoDB.Bson; using MongoDB; using MongoDB.Driver; using System.Security.Authentication; using System.Text; using Newtonsoft.Json; public static void Run(string myIoTHubMessage, ILogger log) { log.LogInformation($"C# IoT Hub trigger function processed a message: {myIoTHubMessage}"); } I am having Project.json

CosmosDB API selection: does it dictate how the data is stored, or only how we communicate with the instance?

≯℡__Kan透↙ 提交于 2020-01-16 11:32:19
问题 When creating a CosmosDB instance, we can choose the API that we will use to communicate with the instance (e.g. SQL, MongoDB, Cassandra, etc.) What is not clear to me is - does this selection dictates how the data is stored, or only the way we communicate with the instance? For example, if we choose MongoDB, does it mean that CosmosDB will store data in a MongoDB fashion? 回答1: The choice of API does not change how the data is stored. Cosmos DB always stores data using something called atom