azure-cosmosdb

Windows Azure DocumentDB Query Where IN statement

一曲冷凌霜 提交于 2019-12-10 21:07:40
问题 Is possible to use IN statement in DocumentDB query? Like: SELECT * FROM c where c.FormId in(1,2,3,4,5,6,7,8,9,10) I don't want use OR because there are limits (only 6) where (c.FormId =1 or c.FormId= 2 or c.FormId =3 Or c.FormId = 4 Or c.FormId=5 Or c.FormId=6) 回答1: EDIT We just announced support for the IN (and other) keyword in queries http://azure.microsoft.com/blog/2015/05/06/new-documentdb-sql-keywords-operators-and-functions/ Today; there are two ways you could approach this 1) Write a

Cosmosdb Saved data cannot be found in portal but from azure-documentdb-spring-boot-starter

 ̄綄美尐妖づ 提交于 2019-12-10 20:42:25
问题 My project is using azure-documentdb-spring-boot-starter:0.2.0 to interact with cosmosdb: @Repository public interface PingEasyRepo extends DocumentDbRepository<PingEasy, String> { } @Document(collection = "test") public class PingEasy { @Id private String id; private String content; public String getContent() { return content; } public void setContent(String content) { this.content = content; } public String getId() { return id; } public void setId(String id) { this.id = id; } } The code

what is the username and password for the cosmos db emulator

若如初见. 提交于 2019-12-10 19:25:33
问题 I try to import a bunch of JSON files into cosmos db emulator, so localhost. Ik try to do this using the DocumentDB Data Migration Tool. Before anyone says that the tool is not working for cosmos db. According to Microsoft it should work: https://docs.microsoft.com/en-us/azure/cosmos-db/import-data But my problem is I can't connect to my local emulator. I tried Googling, but I can't find a right connection string for the tool to work. Any one any idea what the connection string for local

How can I perform an UPSERT using Azure DocumentDB?

被刻印的时光 ゝ 提交于 2019-12-10 18:46:03
问题 Azure DocumentDB does not support UPSERT. Is there a reasonable work around to achieve the same functionality? Is using a stored procedure which checks if the document exists to determine whether and insert or update should be performed an effective strategy? What if I need to perform thousands of these in bulk? Vote for the feature here: http://feedback.azure.com/forums/263030-documentdb/suggestions/7075256-provide-for-upsert Update - Here is my attempt at a bulk upsert stored procedure.

DocumentDB REST API: x-ms-documentdb-partitionkey is invalid

99封情书 提交于 2019-12-10 18:43:53
问题 I am attempted to get a Document from DocumentDB using the REST API. I am using a partitioned Collection and therefore need to add the "x-ms-documentdb-partitionkey" header. If I add this, I get "Partition key abc is invalid". I can't find anywhere in the documentation that expects the key to be in specific format, but simply supplying the expected string value does not work. Does anyone know the expected format? 回答1: Partition key must be specified as an array (with a single element). For

How to perform join operation similar to SQL join in Azure DocumentDB

点点圈 提交于 2019-12-10 17:51:29
问题 I have a collection in Azure DocumentDB where in I have documents clustered into 3 sets using a JSON property called clusterName for each document. The 3 clusters of documents are templated somewhat like these: { "clusterName": "CustomerInformation", "id": "CustInfo1001", "custName": "XXXX" }, { "clusterName": "ZoneInformation", "id": "ZoneInfo5005", "zoneName": "YYYY" }, { "clusterName": "CustomerZoneAssociation", "id": "CustZoneAss9009", "custId": "CustInfo1001", "zoneId": "ZoneInfo5005" }

Simple DocumentDb stored procedure

喜你入骨 提交于 2019-12-10 17:24:03
问题 I'm trying to create a simple DocumentDb stored procedure to better understand its concepts. In this example, I'm trying to return a all "Female" users. Do I need to concern myself with returning a single matching document or multiple documents? Here's what my user object looks like: { "id": "e85ee3d7-44a5-4250-a116-686e1c2a10f5" "firstName": "Jane", "lastName": "Doe", "gender": "F" } And here's what my storedproc looks like so far: function(gender) { var context = getContext(); var response

Azure Functions DocumentClient could not load type from assembly exception

二次信任 提交于 2019-12-10 16:37:33
问题 I have an Azure Function v2 that calls into an utility library, which in turn instantiates a DocumentClient . When running my function locally, it throws an exception on this line: _client = new DocumentClient(new Uri(cosmosDbEndpoint), cosmosDbAuthKey, Storage.SerializerSettings, connectionPolicy); System.Private.CoreLib: Exception while executing function: ComponentDesignInserter-Http-UploadFiles. Microsoft.Azure.Documents.Client: Could not load type 'System.Diagnostics.Eventing

OData and Cosmos DB

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-10 15:59:58
问题 I'm looking to implement OData v4 for as a querying tool in an ASP.NET Core application I'm working on, and our backing persistence store is Cosmos DB. So far, I haven't figured out a way to make OData queries run against the DocumentQuery IQueryable interface without encountering some sort of exception or error. I was wanting to know if there was a "clean" way to utilize OData against Cosmos Document DB (not the Table API), and if so, how? So far, all I've found is an unofficial library that

DocumentDB / CosmosDB - Entity with the specified id does not exist in the system

无人久伴 提交于 2019-12-10 15:17:53
问题 i tried to connect documentdb from my asp.net website but i am getting this error. Entity with the specified id does not exist in the system DocumentClientException: Entity with the specified id does not exist in the system code as follows in aspx code behind protected async void Page_Load(object sender, EventArgs e) { Response.Write("Page Load<br/>"); await GetData(); } public async Task GetData() { try { Response.Write("<br/> Get Data function Start<br/><br/>"); using (var client = new