azure-cosmosdb

Grails plugin for DocumentDB

偶尔善良 提交于 2020-01-26 00:45:28
问题 We are kind of POC phase where we are trying out Azure. We are using Grails, which has nice support for MongoDb as backend (using GORM), but couldn't find similar support for DocumentDd. If we choose to go with DocumentDb, our choice would be to have a layer (may be kind of DAO layer) which uses documentDb client library and interacts with DocumentDb. Or we fall back to MongoDb, as its provided Azure. Any other choices we have with Grails-DocumentDb? 回答1: You should be able to use DocumentDB

Enable query across partitions on Microsoft.Azure.Cosmos.Client

ぃ、小莉子 提交于 2020-01-25 09:23:06
问题 I'm using .net core Cosmos Db Client nuget Microsoft.Azure.Cosmos v3.4.4 I need to query across partition but I haven't found how to do this like FeedOptions.EnableCrossPartitionQuery as described in the following article https://docs.microsoft.com/en-us/azure/cosmos-db/how-to-query-container Can you help me? Thanksss! 回答1: Cross partition queries are enabled by default in V3. If you do specify a PartitionKey in the QueryRequestOptions , it becomes a single partition query. Source code

What is the size limit of a single document stored in Azure Cosmos DB

耗尽温柔 提交于 2020-01-25 08:22:10
问题 I have a MongoDB database in Azure (registered under a Cosmos DB account) and I read on ms docs that the size limit per document stored is 2MB. However, when I try to store an image buffer that is around 1.7 MB I get the following error: 2019-11-01T00:43:14.057681416Z { MongoError: Message: {"Errors":["Request size is too large"]} 2019-11-01T00:43:14.057757320Z RequestStartTime: 2019-11-01T00:43:13.9695930Z, RequestEndTime: 2019-11-01T00:43:13.9995776Z, Number of regions attempted:1 2019-11

How to group by and order by in cosmos db?

陌路散爱 提交于 2020-01-25 07:23:08
问题 As this doc said, "You currently cannot use GROUP BY with an ORDER BY clause but this is planned". But we do need to group by one field and order by another field. Is there a way to do it? 回答1: According to my research, i'm afraid that there is no such direct official way to use GROUP BY with ORDER BY since the statement you mentioned in your question: The GROUP BY clause must be after the SELECT, FROM, and WHERE clause and before the OFFSET LIMIT clause. You currently cannot use GROUP BY

How to find Duplicate documents in Cosmos DB

元气小坏坏 提交于 2020-01-25 04:19:12
问题 I have seen like a huge amount of data write to cosmos DB from stream analytics job on a particular day. It was not supposed to write huge amount of documents in a day. I have to check if there is duplication of documents on that particular day. Is there any query/any way to find out duplicate records in cosmos DB? 回答1: Is there any query/any way to find out duplicate records in cosmos DB? Quick answer is YES.Please use distinct keyword in the cosmos db query sql.And filter the _ts (System

Spatial Indexes with DocumentDB

北城以北 提交于 2020-01-25 01:49:20
问题 I’m trying to do a spatial query against DocumentDB that looks like this: SELECT * FROM root r WHERE ST_WITHIN({'type':'Point','coordinates':[-122.02625, 37.4718]}, r.boundingBox) to match a document that looks like this in the collection: { "userId": "747941cfb829", "id": "747941cfb829_1453640096710", "boundingBox": { "type": "Polygon", "coordinates": [ [-122.0263, 37.9718], [-122.0262, 37.9718], [-122.0262, 36.9718], [-122.0263, 36.9718], [-122.0263, 37.9718] ] }, "distance": 0, "duration":

Bulk Upload/Import of JSON files to Azure Cosmos DB from .NET Core

佐手、 提交于 2020-01-24 19:22:32
问题 I'm generating some JSON files in .NET Core app. I want to import a json file to Azure Cosmos DB as soon as it is created. Is there some way to achieve it from a .NET Core code. Thanks in advance! 回答1: According to my test, if you want to use Cosmos DB Bulk insert in .Net core application, you need to use the .Net CosmosDB SDK V3 and its version must be larger than 3.4.0. For more details, please refer to the document. My .json file [{ "id": "1", "name": "test1", "age": "20" }, { "id": "2",

Connecting to multiple CosmosDB documents

偶尔善良 提交于 2020-01-24 19:12:43
问题 I am trying to have multiple documents in Cosmos, one will hold some data from a submit form once it is submitted. I am trying to have a few other documents to hold the data for a drop down select list. How am I able to connect to multiple config.containerId to read some data and then write some data? I am currently only able to read/write to one. Thanks for any help! const config = {}; config.host = process.env.HOST || "https://localhost:8081"; config.authKey = process.env.AUTH_KEY || "key";

ARM Template.json Dynamic connectionstring

半城伤御伤魂 提交于 2020-01-24 10:17:08
问题 I have taken a deployment template from azure and added this to a deployment project in Visual Studio 2015. When the Resource Group is made and deployed, everything works well except for the Web Site connectionstrings. I have TableStorage, DocumentDb, and Redis instances all being created by this and cannot figure out how to get the Primary Connection String and Primary Key of these items so that I don't have to go in by hand and add them. looking at the ARM Template Functions ListKeys should

Cosmos DB queries - using ORDER BY when a property does not exist in all documents

若如初见. 提交于 2020-01-23 16:44:26
问题 We are experiencing an issue in when writing queries for Cosmos Document DB and we want to create a new document property and use it in an ORDER BY clause If, for example, we had a set of documents like: { "Name": "Geoff", "Company": "Acme" }, { "Name": "Bob", "Company": "Bob Inc" } ...and we write a query like SELECT * FROM c ORDER BY c.Name this works fine and returns both documents However, if we were to add a new document with an additional property: { "Name": "Geoff", "Company": "Acme" }