azure-cosmosdb

Azure Cosmos DB - bad request - http:400

我是研究僧i 提交于 2019-12-13 18:13:39
问题 Greetings my fellow developers, It is already 3 days I'm struggling with a connection to the Cosmos DB without success. I'm using retrofit as my REST client and GsonConverterFactory for serialization/deserialization. Current status is that I get HTTP:400 (bad request) from Cosmos DB REST API. I have tried to adopt the authentication header generation from this SO answer So here is my code (this unit test is runnable from your development environment. please see gradle.build lines to run it in

Azure CosmosDB (Gremlin API), How to connect using Gremlin.Net

不问归期 提交于 2019-12-13 16:51:21
问题 I am trying to use the Gremlin.Net NuGet package to connect to Azure CosmosDB (Gremlin API), using the Package https://www.nuget.org/packages/Gremlin.Net On Azure Portal, I can obtain the Key (used on CosmosDB client NuGet packages: Microsoft.Azure.DocumentDB and Microsoft.Azure.Graphs) How can I obtain the ssl, port, username and password credentials to connect to Azure CosmosDB (Gremlin API) for use on the Gremlin.Net NuGet package? 回答1: Since you are connecting to the public port of the

Why does HasMoreResults return true when Count returns 0?

谁都会走 提交于 2019-12-13 16:22:22
问题 I'm using Microsoft.Azure.DocumentDB v 1.5.2 (not ready to upgrade quite yet). IDocumentQuery.ExecuteNextAsync().Count == 0 , but IDocumentQuery.HasMoreResults == true . This is causing an (for lack of a better word) infinite loop, which blew out my RSUs. I'm doing an "SELECT TOP 1..." SQL query. 来源: https://stackoverflow.com/questions/48157776/why-does-hasmoreresults-return-true-when-count-returns-0

DocumentQueryException: Query expression is invalid

旧街凉风 提交于 2019-12-13 15:32:57
问题 I need to query a collection in cosmosdb. My entity is: public class Tenant { public string Id { get; set; } public string ClientId { get; set; } public string ClientSecret { get; set; } public string TenantDomainUrl { get; set; } public bool Active { get; set; } public string SiteCollectionTestUrl { get; set; } public override string ToString() { return JsonConvert.SerializeObject(this); } } And my controller action is: [HttpGet] [Route("api/Tenant/GetActiveTenant")] public Tenant

DocumentDB: bulkImport Stored Proc - Getting 400 Error on Array/JSON issue

时间秒杀一切 提交于 2019-12-13 13:53:41
问题 I'm simply trying to execute the standard example bulkImport sproc for documentDB API and I can't seem to pass it an array of objects. I always get 400 errors despite the documentation giving clear direction to send an array of objects .. very frustrating. Additional details: Even if I wrap the array in an object with the array under a property of 'items' and include it in my sproc it still errors out saying the same bad request, needs to be an object or JSON-serialized. When I try to do JSON

The remote server returned an error: (403) Forbidden. At C:\Program Files\WindowsPowerShell\Modules\CosmosDB\3.1.0.293\CosmosDB.psm1

吃可爱长大的小学妹 提交于 2019-12-13 09:25:31
问题 I developed the PowerShell script for creating Database and Collection in the Azure Cosmos DB. #region Parameters $connectionString='XXXXXXXXXXXXXXXXX==' $accountName='demo-account-01' $databaseName='demo-db-01' $collectionName='demo-collection-01' #endregion #region Login into Azure using Interactive Mode # sign in Write-Host "Logging in..."; Connect-AzAccount #Set the current azure subscription Select-AzSubscription -subscription 'Visual Studio Ultimate with MSDN' #endregion #region Create

Querying large collections in cosmos db

守給你的承諾、 提交于 2019-12-13 08:08:37
问题 We currently have a very large collection in our document DB. We want to be able to filter the collection based on some fields in the documents in the collection. When I perform this query via the portal it takes a really long time because there is so much data. When I perform this query via a function app, it cuts out after five minutes due to a time-out. What is the best way to perform this search? Is it possible to perform this search via Application Insights or some sort? I am aware that

Cosmos DB - Partition key for fixed collections

时光总嘲笑我的痴心妄想 提交于 2019-12-13 07:51:46
问题 Can someone advise how to create Fixed collection (throughput - 400 RU) with logical partition keys? Is it possible? It is necessary for me in order to migrate easily to unlimited collection in the future. Thanks. 回答1: You cannot create a fixed collection with a partition key. Also once a collection is created without a partition key, it cannot be converted to a partitioned one without being migrated form one collection to another. 来源: https://stackoverflow.com/questions/53471683/cosmos-db

DocumentDB Spatial Query - Odd Result

最后都变了- 提交于 2019-12-13 07:26:08
问题 I am fairly new to DocumentDB, I have experience with MongoDB. This is my simple document: { "id": "747941cfb829_1453640096710", "geometry": { "type": "Polygon", "coordinates": [ [ [ 0, 0 ], [ 10, 10 ], [ 10, 0 ], [ 0, 0 ] ] ] }, "name": "name", "_rid": "Px12AM4QPgBsAAAAAAAAAA==", "_self": "dbs/Px12AA==/colls/Px12AM4QPgA=/docs/Px12AM4QPgBsAAAAAAAAAA==/", "_etag": "\"07006019-0000-0000-0000-573395f50000\"", "_attachments": "attachments/", "_ts": 1462998499} And this is my query: SELECT * FROM

Morphia not applying sparse option to my index

大城市里の小女人 提交于 2019-12-13 05:14:28
问题 I'm trying to use Morphia to interface with MongoDB, and my Morphia entity looks like this: @Entity(some params about storing the entity) public class Entity implements Serializable { <Some other fields here> @Indexed(options = @IndexOptions(unique = true, sparse = true) ) private String field; <Some other fields here> } I would like this field to be unique if present, but not required (and not unique if not present; multiple entries should be able to exclude this field). My understanding of