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
2
votes
1 answer

Finding a MongoDB document by different types with Mongoskin

This is an example of document that I have in my MongoDB: { "_id": ObjectId('5525039895884d66710d0fc3'), "prid": "63527", "data": { "sku": "HF22-81639", "name": "Product Test", "ean": "8763900872512", …
Despotars
  • 541
  • 1
  • 8
  • 23
2
votes
1 answer

findOne with mongoskin and node

I'm trying (and failing miserably) to get a findOne function working on a mongodb. I followed this tutorial (http://cwbuecheler.com/web/tutorials/2014/restful-web-app-node-express-mongodb/) and it works fine, but when I tried to get just a simple…
user1180888
  • 497
  • 1
  • 10
  • 29
2
votes
2 answers

MongoDb error caused by a big result set

I m actually facing a problem when trying to get a full resultset (~40 result). Each object has ~260 childs references and other objects packed in. Actually, when I try to display 30 objects, it works. But when I try with 40 it doesn't. Each object…
mfrachet
  • 8,772
  • 17
  • 55
  • 110
2
votes
1 answer

Auto-increment field in MongoDb with async bulk insertion

I'm looking at this article about auto-incrementing fields in MongoDb. http://docs.mongodb.org/manual/tutorial/create-an-auto-incrementing-field/ This seems good in theory, but doesn't work in my application where all DB calls are async. Ps, Im…
Anders Östman
  • 3,702
  • 4
  • 26
  • 48
2
votes
1 answer

mongo update query to ignore few fields in update operation

I am using Nodejs based mongoskin driver for mongo database operation. I want to update my document however don't want to update few fields. Following are more details. Request for add: { "name": "Theme Name", "description": "Theme…
joy
  • 3,669
  • 7
  • 38
  • 73
2
votes
0 answers

MongoDB/Mongoskin: $addToSet return value

I'm using MongoDB with Mongoskin with a NodeJS server. I'm trying to add an entry in a document's field using addToSet to avoid adding duplicates. How do I know whether my add was successful or not? Checking the return value didn't really help me,…
kir
  • 581
  • 1
  • 6
  • 22
2
votes
1 answer

On moving to TDD with node and mongo

I want to use mocha to add to my program feature by feature, test by test. var assert = require('assert'); var mongoskin = require('mongoskin'); describe('basic database tests', function(){ before(function(){ }); it('should have 3 users',…
mcktimo
  • 1,440
  • 4
  • 19
  • 35
2
votes
2 answers

Is there a way to list collections with mongoskin?

I already have an established database connection. I need to list the names of the collections in the database. Is it possible?
PerakR
  • 55
  • 9
2
votes
1 answer

mongoskin select special fields rather than all

I'm looking for a way to get special fields from mongoskin find function. in other words in SQL lang we say select column1,column2,column3 from mytable rather than select * currently my query is like below and i want to get specify the fields that…
max imax
  • 2,131
  • 3
  • 15
  • 16
2
votes
1 answer

Inserting multiple document into MongoDB with Mongoskin

I'm trying to insert several documents trough a loop, but I get a problem with the uniqueness of the ObjecId's. I have this function: // Fetch all client documents. db.collection('clients').find({}, {cost: 1}).toArray(function(err, dbDocs) { if…
Anders Östman
  • 3,702
  • 4
  • 26
  • 48
2
votes
4 answers

MongoDB query criterias and projections

I'm bulding an app using Node/Express/MongoDB/Mongoskin. I the database I have a collection namned "clients", where documents containing information about client account. Each client document contains an array that contains invoice-objects, like…
Anders Östman
  • 3,702
  • 4
  • 26
  • 48
2
votes
1 answer

I'm using MongoSkin in my Node.js application and after a period of inactivity it loses connectivity with the database

I'm building my first Node.js application and I've run into an issue with MongoDB. I'm using the MongoSkin driver. Once I start my application it all works great. I can sit and toy with it for an hour and it will continue to work. However, if I let…
CatDadCode
  • 58,507
  • 61
  • 212
  • 318
2
votes
2 answers

make one array of multiple arrays in javascript with mongodb

i have this structure in my mongodb { category:['A','B'], info:....., } { category:['A','F','T'], info:....., } { category:['A','C'], info:....., } { …
andrescabana86
  • 1,778
  • 8
  • 30
  • 56
2
votes
2 answers

How do I set the safe variable in mongoskin?

I am getting this error message: ======================================================================================== = Please ensure that you set the default safe variable to one of the = = allowed values of [true | false |…
user1816679
  • 845
  • 3
  • 11
  • 19
2
votes
1 answer

Correct Use of Mongoskin

I usually work with mongoskin because I like to be close to the database. Usually, I do a setup with a file like db.coffee, that contains just this: mongo = require 'mongoskin' # either local module.exports = mongo.db…
Lanbo
  • 15,118
  • 16
  • 70
  • 147
1 2
3
11 12