Tagged Questions
0
votes
0answers
24 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
17 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
12 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
1answer
29 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
20 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
17 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
29 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
11 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
31 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
29 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
12 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 ...
0
votes
0answers
17 views
Mongoose populate multiple with references
I would like to ask if it is possible in Mongoose to have a field in schema with multiple references. eg. If we have a role field that references to other model specifying that role.
Like User - ref ...
-1
votes
0answers
14 views
How to use sphnix with nodejs to search in mongodb
i want to use sphinx search with nodejs to search in mongodb.
i have installed sphinx using https://npmjs.org/package/sphinxapi but want to know how to write query to search in mongodb.
0
votes
0answers
31 views
command to find the number of connections in mongodb
I have a requirement ti find the number of connections in mongodb. I used the command below to find that
db.serverStatus().connections
It gave me the output as below
{ "current" : 3, "available" : ...
-1
votes
0answers
13 views
Linking my HTML page with my node.js server and MongoDB
I've been working on a very basic commenting system with a NoSQL database. I am utilizing Node.js with a RESTful API linked in. With Mongoose I can connect this to my mongodb database, and through the ...