azure-cosmosdb

Cosmos Mongodb query fails but azure storage explorer works fine?

荒凉一梦 提交于 2020-01-04 02:16:07
问题 I am trying to query a Cosmos MongoDB collection, I can connect to it fine with Robo3T and 3T Studio, and dotnet core mongo client (in a test harness). I can do a count of entities (db.[collection_name].count({})) in all of the platforms, but every query (db.[collection_name].find({}) fails with the following error : Error: error: { "_t" : "OKMongoResponse", "ok" : 0, "code" : 1, "errmsg" : "Unknown server error occurred when processing this request.", "$err" : "Unknown server error occurred

How to use ITranscriptLogger and TranscriptLoggerMiddleware to store chat transcript in cosmos DB

时光毁灭记忆、已成空白 提交于 2020-01-04 01:50:20
问题 I want to store the entire chat history in cosmos DB using ITranscriptLogger and TranscriptMiddelWare, but I am struggling to do so. I have read this MS article, but I want to store it in Cosmos DB and not Blob storage. Also I am trying to instantiate the transcript log in Startup.cs not in Bot.cs, and I have tried to implement it according to this answer without any luck. That is, the transcript is not stored and there's no container in my Azure cosmos DB. I appreciate any help and feedback.

Is partition key needed in queries even though JSON is indexed

自作多情 提交于 2020-01-03 15:15:06
问题 I'm planning on using Cosmos Db (Document Db) and I'm trying to understand how the queries, indexing and partitions relate to each other. How to partition and scale in Azure Cosmos Db talks about the partition key and other documentation indicates that partition key + id = unique id for the document. But then SQL Query and SQL syntax in Azure Cosmos Db says it provides automatic indexing of JSON documents without requiring explicit schema or creation of secondary indexes. I understand that

Change Feed in multi-region Azure Cosmos DB

穿精又带淫゛_ 提交于 2020-01-03 04:51:14
问题 I am using Cosmos DB multi-region (single region write) account. Currently it is enabled in East US and West US. The write region is West US. The Change Feed listeners are deployed in both East US and West US. I wanted to understand, if I can specify that the listeners deployed in East US reads Change Feed from East US and listeners in West US reads Change Feed from West US. Or all the listeners will always read Change Feed from write region? 回答1: You can certainly make your listeners read

WHERE IN with Azure DocumentDB (CosmosDB) .Net SDK

喜你入骨 提交于 2020-01-03 04:40:14
问题 Having seen this question I'm not sure why the following code for my DocDb instance isn't working : var userApps = _docs.CreateDocumentQuery(UriFactory.CreateDocumentCollectionUri(Constants.Databases.Applications.ID, Constants.Databases.Applications.Collections.USER_APPS), new SqlQuerySpec(@"SELECT r.appId FROM ROOT r WHERE r.userId = @userId", (@"@userId", userId).ToSqlParameters())) .ToList() .Select(s => (string)s.appId); var query = _docs.CreateDocumentQuery<Document>(UriFactory

DocumentDB REST API with Postman outputs always “Unauthorized” error

做~自己de王妃 提交于 2020-01-03 02:30:11
问题 I want to retrieve data from my DocumentDB database without a middleware, because I have to implement this into my Ionic App. I followed this documentation from Microsoft, and even used the exact same code from this documentation (with Browserify). In order to test the connection I use Postman, where I input all the required headers. For the master-key I used the primary-key from DocumentDB. Problem is, that the response from the DocumentDB is always the following: { "code": "Unauthorized",

what is “Other” category in CosmosDB monitoring graph?

流过昼夜 提交于 2020-01-03 02:24:09
问题 We are having a problem with a spike in CosmosDB # of requests as well as requests charge in "Other" category. What is the "Other" category. Of course, because of this spike we get emails warning us about RUs overage. Thanks Screenshot of Azure CosmosDb monitoring page 回答1: Yes, I found the same situation on my side. I suggest you turning on the Diagnostics logs and store any requests logs in the storage to check these Other requests. You could follow this official doc to analysis the logs.

How can I pass array as a sql query param for cosmos DB query

為{幸葍}努か 提交于 2020-01-02 10:27:08
问题 I want to pass array as a param to SqlQuerySpec to be able to use it in the IN expression when building query for azure cosmos db. What i'm trying to do is something like we do with regular (string, int etc) params: private SqlQuerySpec BuildQuery(IEnumerable<string> exclTypes) { var queryText = "SELECT * FROM root r WHERE r.Type NOT IN (@types)"; var parameters = new SqlParameterCollection{new SqlParameter("@types", exclTypes.ToArray())}; return new SqlQuerySpec() {QueryText = queryText,

Create a Collection with PartitionKey in CosmosDB

こ雲淡風輕ζ 提交于 2020-01-02 07:46:32
问题 I want to create a Collection in Code using the DocumentClient like this await client.CreateDocumentCollectionAsync ( UriFactory.CreateDatabaseUri(databaseId), new DocumentCollection { Id = collectionId }, new RequestOptions { OfferThroughput = 1000 } ); But how do I add a PartitionKey ? In the CosmosDB Emulator I just add the name of the property on my class for the collection. Cant work it out. Could be I'm missing something fundamental here. Thank you 回答1: You need to set

Create a Collection with PartitionKey in CosmosDB

爷,独闯天下 提交于 2020-01-02 07:46:04
问题 I want to create a Collection in Code using the DocumentClient like this await client.CreateDocumentCollectionAsync ( UriFactory.CreateDatabaseUri(databaseId), new DocumentCollection { Id = collectionId }, new RequestOptions { OfferThroughput = 1000 } ); But how do I add a PartitionKey ? In the CosmosDB Emulator I just add the name of the property on my class for the collection. Cant work it out. Could be I'm missing something fundamental here. Thank you 回答1: You need to set