azure-cosmosdb

Meteor application MongoDB connection timed out with Azure DocumentDB database

▼魔方 西西 提交于 2019-12-11 07:29:50
问题 I'm running a Meteor application with on the top of Nginx server with separate MongoDB database. In configuration file I set MONGO_URL as: "MONGO_URL":"mongodb://user:password@host:port/dbName” I've created MongoDB in Mizrosoft Azure as NoSQL DocumentDB. When I start Nginx to run the app it shows following error in the log file: MongoError: connection 0 to HOST:10250 timed out App 47594 stderr: at Object.Future.wait (DIRECTORY/bundle/programs/server/node_modules/fibers/future.js:449:15) App

What does “absence of any further writes” mean in documentDb eventual consistency model?

偶尔善良 提交于 2019-12-11 07:28:06
问题 The documentDb documentation (at https://docs.microsoft.com/en-us/azure/documentdb/documentdb-consistency-levels) has following information in it: Eventual: Eventual consistency guarantees that in absence of any further writes, the replicas within the group will eventually converge. What does absence of any further writes mean? Lets say that I represent my write operation as W(x, s1, t1) where x is the record/document, updating it to state 1 at time 1. Here are my sequence of write events: W

how to authenticate documentdb stored procedure REST call

﹥>﹥吖頭↗ 提交于 2019-12-11 07:15:25
问题 EDIT: Problem was parameters.ToString(). Also like Lengning Liu pointed out you need to add '/sprocs/sprocname' I'm trying to execute a stored procedure in Azure DocumentDB with a REST call in ASP.NET Core 1.0 / C#. I use the method on this MSDN page to generate the hash: https://msdn.microsoft.com/library/azure/dn783368.aspx I'm getting a 401 Unauthorized repsonse. Is "sprocs" the right document type, or do i have to enter a different type? public class Database { public async Task

Adding a CosmosDB entity, (Unable to resolve iD for entity of type Tenant)

*爱你&永不变心* 提交于 2019-12-11 06:51:07
问题 I am trying to add a cosmosdb document using the following package: https://github.com/Elfocrash/Cosmonaut The api controller is this: [HttpPut] public async Task<IHttpActionResult> PutTenant([ModelBinder(typeof(TenantModelBinder))] Tenant tenant) { //var provider = new MultipartMemoryStreamProvider(); //var contentType = ""; //var content = new byte[0]; //await base.Request.Content.ReadAsMultipartAsync(provider); //if (provider.Contents.Count > 0) //{ // contentType = provider.Contents[0]

{ $t: “”, $v: “”} structure in MongoDB collections using pymongo

半腔热情 提交于 2019-12-11 06:26:51
问题 I'm using pymongo libraries to upload my data into documentDB (it accepts MongoDB libraries). My json data objects (read using the json library from a json file) before sending them to my documentDB collection are in the format of (a portion of the data): ... { "id": [ "{}", "i" ] } ... However, in the database they are stored like: ... { "id": { "$t": 4, "$v": [ { "$t": 2, "$v": "{}" }, { "$t": 2, "$v": "i" } ] } } ... My python code that inserts data into MongoDB is client = MongoClient(

Spark libraries conflect when cosmosdb Lib

佐手、 提交于 2019-12-11 06:03:14
问题 I keep getting a spark library conflict with cosmosdb libraries and unable to resolve it. Please help??? build.sbt name := "myApp" version := "1.0" scalaVersion := "2.11.8" libraryDependencies ++= Seq( "org.apache.spark" % "spark-core_2.11" % "2.3.0", "org.apache.spark" % "spark-sql_2.11" % "2.3.0" , "org.apache.spark" % "spark-streaming_2.11" % "2.3.0" , "org.apache.spark" % "spark-mllib_2.11" % "2.3.0" , "com.microsoft.azure" % "azure-storage" % "2.0.0", "org.apache.hadoop" % "hadoop-azure"

Cosmos DB error code 400 while creating a new document

一曲冷凌霜 提交于 2019-12-11 06:01:22
问题 I've created an Azure Cosmos DB (selecting MongoDB as the language), and while creating a new document through the Azure portal (website) it fails and says: {"code":400,"body":"Command insert failed: document does not contain shard key."} I tried to create the following document through the website: { "wordpress_id": "test" } And this: { "id" : "replace_with_new_document_id", "wordpress_id": "test" } "wordpress_id" is a "Shard key" (or partition key) that I defined when I created the

How to use DocumentDB behind a Proxy in NodeJS

大憨熊 提交于 2019-12-11 06:00:10
问题 In NodeJS I`m trying to connect to a Cosmos DB using the Documentdb library, as the getting starter of the azure documentation says in the TODO List Example. Tutorial Here If I use an Internet that is not behind a proxy it works. This is the connection code: var DocumentDBClient = require('documentdb').DocumentClient; var docDbClient = new DocumentDBClient(config.host, { masterKey: config.authKey }); But when I'm behind a proxy, the connection never occur's. I`m getting an "Error: connect

How to query $near in CosmosDB via mongoDB protocol

此生再无相见时 提交于 2019-12-11 05:37:48
问题 I have this document { "_id" : "8cbc4fdc79d5479c95deaab471d359bb", "category" : "test", "location" : { "name" : "Café Café", "coordinates" : { "type" : "Point", "coordinates" : [ 34.788589, 32.0857813 ] } } } And this query returns 0 records on CosmosDB, but works as expected on real mongoDB db.activities.find({'location.coordinates': { $near :{$geometry: { type: "Point", coordinates: [ 34.788589, 32.0857813 ] }}}}) 回答1: Based on my test, if I use $near in a query, as you said, it returns 0

DocumentDB Stored Procs: what does the EnableScriptLogging option do?

孤人 提交于 2019-12-11 05:28:32
问题 The DocumentDB APIs for working with stored procedures take an optional RequestOptions argument that has, among others, the property EnableScriptLogging . The help page for it is useless. The description for it is: EnableScriptLogging is used to enable/disable logging in JavaScript stored procedures. Mkay... so how do I log something ? (assuming that's console.log(...) ) And more importantly, how do I read the logs generated by stored procedures? I was expecting the response of requests to