Questions tagged [mongoskin]

MongoSkin is an easy to use Node.js driver for MongoDB. It builds on the `node-mongodb-native` driver with support for additional JavaScript method binding which allows it to act as a Model (in a document way).

MongoSkin is an easy to use Node.js driver for MongoDB. It builds on the node-mongodb-native driver with support for additional JavaScript method binding which allows it to act as a Model (in a document way).

Installing/upgrading

$ npm install mongoskin

Documentation

178 questions
0
votes
1 answer

mongoskin db.collection.find().toArray() don't work in os x

why this code work well in linux (ubuntu12.04). don't work in os x 10.8/9 (node version, mongoskin version is the some) var mongo = require('mongoskin'); exports.test = function(req, res) { var db = mongo.db('localhost:27017/btc', {safe:…
zhaoyou
  • 308
  • 4
  • 19
0
votes
1 answer

making mongoskin function is asynchronous sync

User.prototype.isUnique = function () { var result; db.user.count({name:'abcdefg'}, function(err, count){ console.log('the count is: ' + count); result = count; }); return result; } this function is used to find out…
Nicolas S.Xu
  • 13,794
  • 31
  • 84
  • 129
0
votes
0 answers

Multiple document update through single document update query in a loop

I'm building an app in Node/Express/MongoDB with Mongoskin. In this app, there is a scheduled function, that runs at the beginning of every month. This function consist of the following code: clients.find({}, {cost: 1, invoices: 1…
Anders Östman
  • 3,702
  • 4
  • 26
  • 48
0
votes
0 answers

Javascript: recurse through object properties and replace a property if key or value matches pattern

I am accepting a user-supplied JSON string that looks like MongoDB query and I want to do some validation and processing on it and issue it to MongoDB as a query. I'm using MongoSkin driver for node.js the query string might have an _id field, and…
rogodeter
  • 460
  • 9
  • 19
0
votes
1 answer

Assert uniqueness in MongoDB

I'm using Node, Express and MongoDB (with Mongoskin) for a webbapp. New client accounts are created through a web form, requiring inputs such as 'Company', 'Contact person', 'Email' et cetera... When creating new clients there are some fields that…
Anders Östman
  • 3,702
  • 4
  • 26
  • 48
0
votes
1 answer

Mongoskin Connection Fails (Error: connection closed)

I'm totally new with all the technologies I'm trying to do this with, but I have what seems like some simple code (gleaned from a tutorial) that I just can't get to work. I'm using Node, Express and Mongoskin/MongoDB. Whenever I try any operation…
Chris Anderson
  • 666
  • 3
  • 4
0
votes
1 answer

mongoskin dynamic collection name error

I need to insert into a Mongodb collection where the collection name is inside a variable. but it seems its not possible or my code is wrong. db.collection(colname).insert(dbjson, function(err, result) { if (err) throw err; if (result)…
max imax
  • 2,131
  • 3
  • 15
  • 16
0
votes
2 answers

Trouble deploying to Heroku using Mongoskin and MongoHQ with Nodejs

I'm currently building a node/express.js app that uses mongoskin. I recently deployed my app to Heroku and having tons of headache with incorporating mongohq to work with my app. This is the app.js file which I run with node app.js var express =…
dazer
  • 223
  • 1
  • 4
  • 14
0
votes
1 answer

Querying Embedded Documents MongoDB

Let me be straight with the question, OK I have document structure like let the collection name be sample; were i'll not be knowing the someIdAsString. { _id : ObjectId("someObjectId"), test : { someIdAsString : { field1 : value1, …
Beast
  • 617
  • 2
  • 8
  • 19
0
votes
1 answer

Trouble with node-mongoskin on OS X 10.8

I had install module mongoskin (sudo npm install mongoskin -g) - success install. When i try to start my index.js with (supervisor index.js), there's this error: module.js:340 throw err; ^ Error: Cannot find module 'mongoskin' at…
smithua
  • 53
  • 6
0
votes
1 answer

Mongo query to filter out the elements inside an array of objects

There is db structure were the value is array of objects like { key : [ { retrive : false }, { retrive : true } ] } And i want to query only the objects were 'retrieve' key is set to true.
Beast
  • 617
  • 2
  • 8
  • 19
0
votes
1 answer

Mongoskin: set a document schema

I want to use node & mongoskin, and define a document's schema ( which key is unique, which key has a default value, etc... ) How can I do it?
AntouanK
  • 4,880
  • 1
  • 21
  • 26
0
votes
1 answer

How to specify individual username & password parameters with mongoskin?

I'm connecting to a mongodb db with authentication with mongoskin, and know you can specify a db user like this: [*://][username:password@]host[:port][/database][?auto_reconnect[=true|false]] However im getting some malformed url errors (presumably…
UpTheCreek
  • 31,444
  • 34
  • 152
  • 221
0
votes
1 answer

mongodb wrong when i try to findandmodify

this is the structure in mongodb { code:'ACBD5588', email:'owner@mail.com', object{ array_doc:[//many documents with this structure { code_doc:'ANCB7894', info_doc:'....', //etc …
andrescabana86
  • 1,778
  • 8
  • 30
  • 56
0
votes
1 answer

pull subdocument in array mongodb

i have in mongodb this structure {doc: { array_doc:[....//many documents]} } im using mongoskin in mongodb 2.2 with nodejs 0.8 var code_doc='HSKD41814541211'; var db = mongo.db(perm+"@127.0.0.1:27017/database",{safe:true}); …
andrescabana86
  • 1,778
  • 8
  • 30
  • 56
1 2 3
11
12