0
votes
0answers
18 views

Pass Array in MongoDB MapReduce scope

I'm working on a a MapReduce execution on my Node.js + Express.js server. I'm using Mongoose as ODM, and I need to pass a key-value array named _affinities into the map function global scope. To do ...
0
votes
1answer
45 views

long polling and queue to hold requests

POST /add-request - adds new request POST /get-request - returns first (oldest) request I have many Java apps which are called "slaves". Their job is to call POST /get-request to get request to ...
0
votes
2answers
38 views

Retrieving Dates in MongoJS

I'm trying to store and retrieve a date in mongojs. Here's how it's saved: var game = { startedOn: new Date() }; db.games.save(game); When I fetch it, the date is not a date anymore. It's some kind ...
0
votes
0answers
27 views

Proper way to desing a no-sql db?

I want to build a multi-company node.js helpdesk app vs a mongodb. It is now the moment to design the database, i would have not doubts if i was in relational world, but would like to study no-sql db ...
0
votes
1answer
42 views

How to persist a MongoDB cursor in between requests?

In the contest of a web server: In order to avoid re-querying (using find), one could try and keep between requests the cursor reference returned by find. The Cursor object is a complex object ...
0
votes
0answers
27 views

How to use node-mongodb-connection for connect-mongo

I make connection to my database like the following: var mongoClient = new MongoClient(new Server('localhost', 27017, {auto_reconnect: true})); mongoClient.open(function (err, mongoClient) { var db ...
0
votes
1answer
26 views

Querying by example using MongoDb, Express in NodeJS is being escaped incorrectly for some reason. I am unable to search

I am working on a generic query method for an API (REST) using nodeJS, MongoDB and Express. After the routes forward to my module the request, everything works as expected when performing literal ...
0
votes
0answers
18 views

Using Mongoose JS to get array of pointer values for document, and expand return

What I am trying to do is the following. I have objects that could live in multiple documents, and although I am not sure if this is best practice, I am using their ObjectId as pointers. Document A ...
0
votes
0answers
30 views

Trouble with automatic failover with sharded and replicated Mongodb setup

I'm using Mongodb with only one shard and 3 members in a replica set. I have each replica set member on a different machine. Two members each have a mongos router, one member (that has a router) has a ...
1
vote
0answers
23 views

Equivalent to mongo shell db.collection.runCommand() in Node.js

I'd like to use full text search available in MongoDB 2.4. Text search is available through runCommand function e.g. db.collection.runCommand( "text", { search: "keywords"}). So, I'm wondering ...
1
vote
1answer
20 views

When pushing local Node.js project Git repo that has node_modules up to Heroku, do the local node_modules overwrite those on Heroku?

I want to understand better the relationship between the node_modules that are part of my Node project on my local machine and those that are part of my app that resides on Heroku. When I'm building ...
-1
votes
1answer
24 views

Insert returning an array with 1 object [closed]

I am making an insert with native mongodb for nodejs and in some cases, using insert returns me an array with the object I inserted, but sometimes it does not. I don't understand why it is ...
0
votes
1answer
23 views

Mongodb query from any array position

My schema looks like this: { _id: "myid" user: [{"name":"Bob"}, {"name":"Jenny"}] }, { _id: "myid2" user: [{"name":"John"}, {"name":"Jenny"}] }, { _id: "myid3" user: [{"name":"John"}, ...
0
votes
1answer
31 views

flexible query method/function for MongoDB + Express using NodeJs

I am working on an API with MongoDB+Express+Node.js. So far so good, I can query for one record by ID, I can query for a specific field, delete, add, etc. I am looking for a method that can be called ...
0
votes
1answer
24 views

Is it possible to return only a certain fields when inserting a new document?

I nedd to get the new document back with _id field only. Something like this: db.users.insert({name: 'Jonh', age: 27}, {_id: true} , function (err, user) { if (err) {} // need to be user with ...
0
votes
0answers
25 views

Ember Rest Adapter with node.js express and mongodb, can't do the right mapping for the model

I started to work on Ember, and I'm trying to make a rest adapter with node.js, express and mongodb. I wrote this server.js file : var express = require("express"), path = require('path'), users = ...
0
votes
2answers
22 views

mongodb - understanding read operations

Suppose I have a collection: db.person.insert( [ { _id: 3, name: { first: 'Grace', last: 'Hopper' }, title: 'Rear Admiral', birth: new Date('Dec 09, 1906'), ...
-1
votes
2answers
48 views

Insert values into MongoDB (Node.js, mongojs, express) [closed]

Respected ppl ... Im trying to insert my jsons which im building into mongodb ... var newjson = JSON.stringify(json); console.log(newjson); db.mongostuds.save(newjson, ...
0
votes
3answers
41 views

Is there any other way to call a javascript function stored in mongodb from node js

Is there any other way to call a JavaScript function stored in MongoDB from node.js other than db.eval()? Tried db.eval() since its degrading my server performance, I'm have to use some other methods ...
0
votes
1answer
50 views

Is it bad idea to use custom pk as string?

Let me explain the problem. I use node-mongodb-native as mongod driver and every time I need to make find query by _id field I have to convert it to ObjectId like the following: var ObjectID = ...
0
votes
1answer
21 views

Node/MongoDB scraper - Deleting records that are no longer valid

This seems like a pretty simple thing but I can't find any discussions that really explain how to do it. I'm building a scraper with MongoDB and Node.js. It runs once daily and scrapes several ...
0
votes
0answers
18 views

connect to mongodb remotely node.js

I know this is kind of trivial, but I have been searching on google for a solution to this problem, this here is my first time deploying a mongodb+node.js application, I have succeeded in hosting a ...
1
vote
2answers
43 views

Having trouble iterating through array and saving to mongoose. Callback issue?

I'm learning node, express, mongo, and, in the process, javascript. I'm trying to get a feature where using rssparser, get a list of stories and save them to a mongo database with mongoose. I've got ...
0
votes
1answer
21 views

Mongoose Regex on Virtual Field

I'd like to run a regex to achieve a "LIKE" type functionality on a virtual field in my User schema. The following statement works for all of the fields except *fullName* var searchString = ...
0
votes
0answers
21 views

Mongoose - How to query on populated fields

I have a collection "orders" with some documents which have two "ref" fields (customer, manager) to a "user" table. I would like to get the documents of which the customer and/or manager names match a ...
0
votes
1answer
31 views

how to know mongodb version through mongojs

dburl = "mongodb://127.0.0.1:27017/demo"; db = require('mongojs').connect(dburl); console.log(db.version); I want to know mongodb version using mongojs.
0
votes
1answer
16 views

node-mongodb-native: multiple Db connections for the same replica set?

I've got a replica set holding two different databases: db1 and db2. With node-mongodb-native, how do I access these two databases? I'm trying to do something like this right now: var mongo = ...
-1
votes
0answers
32 views

How can I connect on multiple databases with nodeJs? [closed]

I am in a scenario where I have two asynchronous methods that need to connect on a different database each. In the first method I make a write operation and on the second I make just read operation. ...
0
votes
0answers
46 views

Retrieving MongoDB Subdocuments with Node.js and Express.js

I created a RESTful API using node.js, express.js, and mongodb. I started creating my routes by pulling documents from a MongoDB collection which work perfectly. Example Collection Document { "_id" ...
0
votes
1answer
14 views

retrieving data from mongodb in jade template

I'm new to node and mongodb and am trying to render a database query in a template, but I get the error that the property is undefined: Cannot read property 'firstname' of undefined Here's my ...

1 2 3 4 5 77
15 30 50 per page