1
vote
1answer
61 views

how to manipulate returned mongo collections / cursors in javascript (meteor.js)?

In working with Meteor.js and Mongo I use the find({some arguments}) and sometimes find({some arguments}).fetch() to return cursors and an array of matching documents respectively. What is the real ...
0
votes
0answers
24 views

Mongoose only saves certain fields (Mongoose + Restify)

This code won't save to my MongoDB. If I change doc.foursqure_key to doc.username or doc.password, it saves just fine. @User.findOne({ username: 'justin' }, (err, doc) => ...
0
votes
1answer
38 views

MongodB in operator return on blank array when it should not

I have a template function in coffeescript running on the client: Template.leftNav.starred = () -> user = Meteor.user() if ! user return else starredPages = ...
1
vote
1answer
327 views

Create an ISO date object in javascript

I have a mongo database set up. creating a new date object in mongoDb create a date object in ISO format eg: ISODate("2012-07-14T00:00:00Z") I am using node.js to connect to mongo database and query ...
0
votes
1answer
107 views

MongoDB and constructors/classes in node.js (async)

I want to abstract certain MongoDB queries/documents using classes. Basically I think the way is to somewhere (an own class?) create the connection and use this connection(pool) in various Classes. ...
0
votes
1answer
253 views

Mongoose and EveryAuth Reference/Example/Tutorial

I'm working on authentication system for my website. I currently am working with the naive MongoDB driver for node, and my own custom authentication system, but I'm looking to switch over to the ...
0
votes
1answer
55 views

How to print a mongodb cursor?

#Database Testing Method. socket.on 'databaseTesting', -> db.collection 'documents', (err, collection) -> console.log 'Printing documents...' ...
2
votes
1answer
284 views

Can I determine if a string is a MongoDB ObjectID?

I am doing MongoDB lookups by converting a string to BSON. Is there a way for me to determine if the string I have is a valid ObjectID for Mongo before doing the conversion? Here is the coffeescript ...
0
votes
1answer
68 views

Meteor Troubling Creating new Record

I'm running Meteor 0.5.2 with the insecure package on + the coffeescript package on. Cards = new Meteor.Collection "Cards" if Meteor.isClient Template.makeCard.events # HANDLES ...
1
vote
1answer
120 views

Mongoose document update error

Been working with node and mongoose lately and I enjoyed it until I had to update a model. Here is what I'm doing: module.exports.update = (post, cb) -> Post.update _id: post._id, post, (err, ...
0
votes
1answer
641 views

Updating subdocuments with Mongoose

Okay, so I'm trying to update a subdocument (embedded document) with Mongoose. I have: query = 'fanclubs.fanclub_id': fanclub_id fan_update = 'fanclubs.$.fanclub_name': ...
1
vote
1answer
144 views

CoffeeScript Mongodb variable passing

db.collection('database_name') .find( { 'active':true, 'iOS':true} ) .toArray (err, dbDocs) -> returns me a result set . However, deviceName = 'iOS' db.collection('database_name') .find( ...
-1
votes
1answer
156 views

MongoDb and Nodejs Server Response

In my javascript class, i have a function that return a list of things like so, //ProjectClass.js getProjectList: () => @Project.find (err, projects) => console.log(projects) ...
0
votes
2answers
74 views

Can't get query results outside the function

I have this class in which i try to initialize array attributes with query results: class data minute: [] hour: [] constructor: () -> findMin = ...
0
votes
2answers
92 views

how to return a value for a function in coffee-script

I used coffee-script to write node.js, it works fine, what i want to know is how to return a value for a function in coffee-script, here is my code exports.find=-> db.open((err, db)-> ...
0
votes
3answers
155 views

Profiling mongoose methods

I want to see logs of calling methods for all my mongoose methods, like this: # Load Book LoadBook = (id, cb) -> console.log 'loading book...' Book.findById id, (err, book) -> if err ...
2
votes
1answer
602 views

Calling node-mongodb-native inside node-csv-parser: RangeError: Maximum call stack size exceeded

I'm using node-csv-parser to read in csv data and store it in mongodb using mongoose. However I'm trying to speed up the import, and I want to evaluate using the native save method exposed by ...
0
votes
2answers
450 views

Possible ways to call external javascript function (object) in mongo map or reduce context

Preface: in order to have clean and effective code, i want to use external functions in my mapreduce mongo script. Problem: given we have following map function (coffeescript syntax): map: -> ...
2
votes
1answer
2k views

Querying nested embedded documents with Mongoose

I'm trying to query inside an embedded document that is nested. I've attempted to 'populate' the results but that fails. How do I get back all of the book details inside the find call? I want all of ...
0
votes
2answers
235 views

Relationnal model with Towerjs (coffeescript & mongodb)

I need to recover in towerjs (with mongodb store) quote stock from all stock in all trades of one user. This code don't work, the while loop does not stop, but I do not understand why ...
2
votes
1answer
465 views

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 ...
1
vote
0answers
170 views

Existing open source, non-web node.js coffeescript chat server/client using json & mongodb? [closed]

I am wondering if there is already some open source solution out there for a simple (non-web based) node chat api (with server/client), done with coffeescript, which can store chat messages in ...
3
votes
0answers
583 views

Not able to start towerjs server after creating a new application “Cannot find module mongodb” [closed]

I'm a node newbie and have just started playing around with it. Since I have used rails a fair bit before I wanted to use a framework on node that is built around the same principles as rails. ...
1
vote
3answers
859 views

How to wait for sub process results before returning from Meteor.method

I'm kinda surprised that the Meteor.method definitions require a result to be returned rather than a callback be called. But so it is! I'm trying to make an RPC method in Meteor that calls mongoose ...
0
votes
1answer
732 views

Coffee-Script Nodejs and Mongoose

Hey all trying to play with nodejs MVC using express and mongoose. I have the following code: mongoose = require 'mongoose' Schema = mongoose.Schema mongoose.connect 'mongodb://localhost/quotes' ...
0
votes
1answer
117 views

No errors - still no write

Getting node.js and gridfs to play nice is not easy. Of all the things I tried, I settled on this being as close as I could get with limited knowledge and what I understand the current supported ...
1
vote
3answers
612 views

Coffeescript, nodejs, mongoDB and JasperReports, is it possible?

I just realized a JSF (web javascript application) that connect to mongoDB database and generate a report (PDF) thanks to JasperReports Library. (so with a .java file) Is it possible to do the same ...
5
votes
4answers
2k views

Backbone.js and Embedded One-To-Many Associations

The App Layout I am building an App, where one can create surveys. Every survey has multiple questions. I am embedding the questions into the survey model (with embeds_many in Mongoid), so a survey ...
6
votes
2answers
3k views

How to Wait in Node.js

Here is a question about what I would think would be a simple pattern in node js. Here is my example in coffeescript: db_is_open = false db.open -> db_is_open = true wait = -> wait() until ...
2
votes
2answers
1k views

How can I upsert using Mongoose based on _id?

When I do this: client_id = req.param("client_id") ? null client = name: req.param "clientName" status: 'active' Client.update {_id: client_id}, client, {upsert: true}, (err, updRes) -> if ...

1 2
15 30 50 per page