mlab

Using $push in MLAB's MongoDB REST API

霸气de小男生 提交于 2019-12-11 15:59:52
问题 I am using NodeJS to write a post query to insert an object in array through the MLAB REST API but I am getting error in making the API call. The Json Object is like : { ..... "someattriute" : "somevalue", "attributenew" : [ {"a":"a1","b":"b1"} ], ..... }, { .... } The NodeJS API call is like : request.post('https://api.mlab.com/api/1/databases/cabchain/collections/rides?q={"someattribute": "'+"somevalue"+'"}&apiKey=....', { json: { "$push": {"attributenew": {"a": "a2", "b": "b2"}} } },

“Invalid ns” when connecting to mongodb server

梦想的初衷 提交于 2019-12-11 08:21:28
问题 Im trying to connect to a MongoLabs mongodb server I setup for a small project Im working on. I can connect fine when connecting from my local machine, but when I try to make a connection from my Mediatemple server I get a 'Invalid ns' error: Unable to connect to MongoDB: Failed to connect to: dsXXXXXX.mongolab.com:27769: send_package: the query returned a failure: Invalid ns [XXXXXX_dev/XXXXXX_dev.$cmd] (code: 16256) Any suggestions on how to fix this would be a major help. 回答1: Perhaps your

After meteor bundle, node.js is “LISTENING” but not showing up at localhost

為{幸葍}努か 提交于 2019-12-11 02:52:52
问题 I'm bundling a meteor app and running the uncompressed tarball with node. I am not sure why the app doesn't seem to appear on localhost. Here is how I'm bundling: $ meteor bundle app.tar.gz Then I uncompress: $ tar -zxvf app.tar.gz Then I cd into the bundle directory and do as the README says: $ rm -r programs/server/node_modules/fibers $ npm install fibers@1.0.1 $ export MONGO_URL='mongodb://<dbuser>:<dbpassword>@<PORT>.mongolab.com:<PORT>/<db>' $ export ROOT_URL='http://localhost:3000' $

Mongolab connection error

让人想犯罪 __ 提交于 2019-12-10 20:20:17
问题 I'm getting the following message when I try connecting to MongoLab with the command: mongo ds035438.mongolab.com:35438/comeventsbw -u (myusername) -p (mypassword) MongoDB shell version: 3.0.6 connecting to: ds035438.mongolab.com:35438/comeventsbw 2015-12-10T10:30:18.537-0700 I STORAGE In File::open(), ::open for '/Users/benwong/.mongorc.js' failed with errno:13 Permission denied The ".mongorc.js" file located in your home folder could not be executed 回答1: You can try to delete the root

Mongo::OperationFailure - need to login when using from_uri

橙三吉。 提交于 2019-12-10 18:52:03
问题 My goal is to connect with my heroku/mongolab database but I keep getting this error: Mongo::OperationFailure at /mongotest/a/b : need to login file: networking.rb location: send_message_with_gle line: 89 The code I'm using is: client = Mongo::MongoClient.from_uri(ENV['MONGOLAB_URI']) db = client.db('test') testcoll = db['testcoll'] testcoll.insert({:'_id' => "def", :'test' => "woop de doop"}) testcoll.find() ENV['MONGOLAB_URI']=mongodb://heroku_app########:password@ds0xxxxx.mongolab.com

how to solve this transaction error in mlab? [MongoError: Transaction numbers are … support document-level locking]

霸气de小男生 提交于 2019-12-10 01:59:08
问题 I'm trying to do a simple transaction using mongoose . It worked totally fine on MongoDB Atlas , but in mlab I got such an error: MongoError: Transaction numbers are only allowed on storage engines that support document-level locking . I did some research, but didn't really find any resources regarding mlab and document-level locking . Does anyone know how to solve this problem? 回答1: I have same issue, then I contact mlab help, here is their reply: That error indicates your app/driver is

Recurring rails error on Heroku/Unicorn - 'execution expired', an ActionView::Template::Error

北慕城南 提交于 2019-12-09 14:54:37
问题 My question is similar to the following, but is happening under slightly different circumstances. Rails: execution expired on time_zone_select My setup is: Rails 3.2.13 Unicorn 4.6.2 Mongoid 3.0.22 Moped 1.4.2 Running on Heroku Cedar. MongoDB is hosted at MongoLab. The errors come in batches and are often solved by a Heroku process restart. The first is usually the one below: An ActionView::Template::Error occurred in [controller]#[action]: execution expired vendor/bundle/ruby/1.9.1/gems

Is there ReadOnly REST API key to a MongoLab database, or is it always ReadWrite

为君一笑 提交于 2019-12-08 18:27:26
问题 In MongoLab you generate an API key and then anyone can access your database using REST API. Usual case is to use the REST api directly from Ajax clients. But this gives anyone complete write access to your database, which is security hole. Is there a way to generate an API key which will give READ ONLY access to the database 回答1: Currently, all API keys have read and write access to the databases associated with the user's account. If you need to expose a read-only API we recommend building

angular + breeze + mongoLab

拜拜、爱过 提交于 2019-12-08 12:17:50
问题 I try to use breeze in Angular with MongoLab Api in plunkr. var dataService = new breeze.DataService({ serviceName: "https://api.mongolab.com/api/1/databases/webuniversite?apiKey=apikey", hasServerMetadata: false, }); var manager = new breeze.EntityManager({ dataService: dataService }); I get "Origin http://run.plnkr.co is not allowed by Access-Control-Allow-Origin. " message. Any idea for use of MongoLab together with Breezejs. 回答1: We're not ready for MongoDb yet. Almost. Very soon. There

Use Heroku addon mongolab with node.js

家住魔仙堡 提交于 2019-12-08 03:43:29
问题 I am using node.js with mongo lab and I have followed the mongolab tutorial (https://devcenter.heroku.com/articles/mongolab#getting-your-connection-uri) to change my url of db like this in my code: module.exports = new Db(settings.db, new Server('mongodb://heroku_app3178:e6dd5g3btvanua3gfbmk6@ds051740.mongolab.com', 51740, {}), {safe: true}); I tested with local run, and I indeed see node is trying to connect to this new URL. But when I deploy to Heroku. Heroku always complain about this. I