What is the proper way to manage connections to Mongo with MongoJS?
Problem
I'm attempting to use MongoJS as a wrapper for the native Mongo driver in Node. I'm modeling the documents in my… Read More
Return mongojs query result from function
Problem
I made the function below for getting usernames from ids. It is not working well.
I can write console.log(result.first_name); within the qu… Read More
mongoJS parsing JSON output
Problem
I'm playing with nodeJS and mongoJS. I've successfully queried the DB and returned a set of data:
var databaseUrl = "redirect"; // "username:passwor… Read More
How do I capture a MongoDB query as a string and display it in my Node JS page (using the mongojs driver)?
Problem
I would like to be able to query my mongoDB and display this result on my… Read More
how to delete a record using mongojs
Problem
I am using mongojs together with nodejs and express. From so many online documents I only found find() save() update() methods. Is there a dele… Read More
How to select value from MongoJS query output
Problem
I have MongoJS query call:
db.users.find({username:"eleeist"},function(err, docs) {
console.log(docs);
});
The docs variable loo… Read More
Cannot call the method save of undefined. Mongojs
Problem
I have a simple method as follows to write to a mongodb database. It uses the Mongojs module. Everything seems fine with the exce… Read More
MongoJS not returning data when searching with regular expressions
Problem
Node.js, mongojs, mongodb.
I am searching through a list of skills using regular expressions. Here is my server c… Read More
node.js mongojs findOne callback returning error as null
Problem
Presently being driven up the wall by this error.
I am running a node.js app with the mongojs wrapper for mongodb. I Starte… Read More
How do I pass variables in mongojs query in the key name
Problem
Each document in my users collection looks like this:
access: { 123456789012345678901234: 3, 123456789012345678901235: 2, 12… Read More
How to enable Mongojs Safe Option?
Problem
Consider the following nodejs code:
db = require('mongojs')('database', ['users, sessions']);
db.users.insert(
{
'email': email,
'password':… Read More
Node.js/Mongojs nested db callbacks return
Problem
I am implementing a restify middleware for session authentication. The function contains nested asynchronous db calls: db.sessions.remove(… Read More
socket.io returns [object Object] from mongojs query
Problem
I've started looking at socket.io and some MongoDB with mongojs.
Summary: Client doesn't send data to server through socket.io… Read More
mongojs implementation of non blocking query
Problem
I know this must be a really silly question, but I can't figure out how to make it work. I'm learning node.js and mongojs, and this is m… Read More
Node.js + MongoDB without MongoJS
Problem
Question is as you might have guessed from title, if I can use Node.JS with connected to MongoDB, without loaded MongoJS module.
I want to minimiz… Read More
nodejs and mongodb (mongojs): Trying to query and update database within a for loop
Problem
I'm writing a multiplayer game(mongojs, nodejs) and trying to figure out how to update user stats… Read More
NodeJS does not respond to CURL Request
Problem
Im using NodeJS to perform som Queries to a MongoDB.
I've set up the routing so when
http://127.0.0.1:8888/GetAllCities
is called, a… Read More
How can I loop through docs to send a lot of mongojs data to a jade template?
Problem
So, I'm using mongojs. To get values into a rendered view, it was my understanding that one had to do s… Read More
Why do I need Mongoose or Mongojs for Node.js?
Problem
Major Questions
Currently I'm very confused, the main questions are: What is the use of Mongoose/Mongojs? What would be different if… Read More
MongoJS: size() method or length not available
Problem
I just installed the latest versions of node.js and MongoDB and a driver for node.js: MongoJS
Now I tried to find out (with good perf… Read More
CORS on node subdomain
Problem
I am trying to set up an API on a sub domain and because of this I also try to set up an JavaScript API after the Web API.
But unfortunally I am getting an e… Read More
Mongojs callback not returning
Problem
I am using mongojs to update data in a mongodb collection. The program reads a file line by line and for each line it makes an update in the mongodb d… Read More
MongoJS increase pool size
Problem
I am building a simple application using Node.js and MongoDB through the MongoJS driver. I am aiming at some heavy load (round 10000 users in 10 mins with… Read More
It becomes necessary to choose the appropriate website framework with regard to JavaScript. It is the sole decision of the entrepreneur or businessman to choose the version of JavaS… Read More
node.js - newbie mongojs issue
Problem
I am trying to learn MongoJS, But its not working.
I wrote this code so far -
/* Basics */
var express = require('express'),
app = express()… Read More
Mongojs - how to push to array?
Problem
I have the following code:
db.users.save({
username: "admin",
array: [{
foo1: "foo1",
foo2: "foo2"
}, {… Read More
Mongojs: Ignoring Duplicate Objects Insertion
Problem
I have this Node.js application that it gets a large sum of JSON data with unique ids and then inserts them into a MongoDB using Mongoj… Read More
retrieving data from mongodb in jade template
Problem
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:… Read More
how to know mongodb version through mongojs
Problem
dburl = "mongodb://127.0.0.1:27017/demo";
db = require('mongojs').connect(dburl);
console.log(db.version);
I want to know mongodb versi… Read More
Equivalent to mongo shell db.collection.runCommand() in Node.js
Problem
I'd like to use full text search available in MongoDB 2.4.
Text search is available through runCommand function e.g… Read More
Insert values into MongoDB (Node.js, mongojs, express)
Problem
Respected ppl ...
Im trying to insert my jsons which im building into mongodb ...
var newjson = JSON.stringify(json);… Read More
MongoDB: Adding an array into an existing array
Problem
I'm trying to add an "Instructors" array into an already existing "Camps" array.
The hierarchical structure looks something like thi… Read More
How do I store a mongojs query result to a variable
Problem
All i get from this code:
var views = db.books.find({"number":1}, {"views":1, _id:0});
console.log(views);
is this response:
{… Read More
how to wait the end of the execution of a function
Problem
I have a main in nodejs for my program where I need to use my result calculated in a module, but my I don't have the right result… Read More
why update doesn't work
Problem
I pass a json variable to a module but I can't do the update of my collection, always I have an error in the updating.
var gestion = function(myJSON) {
var… Read More
Correct way to search for MongoDB entries by '_id' in Node
Problem
I'm using MongoDb (as part of MongoJS) in Node. Here is the documentation for MongoJS.
I'm trying to do a call within Nod… Read More
NodeJS - Is Mongoose faster than MongoJS?
Problem
I've got an application that runs on NodeJS, and uses MongoDB as a database for information.
Currently I hook into MongoDB via the MongoJS… Read More
MongoDB: $push into an array based on a variable's contents
Problem
I'm trying to $push an item into my record in MongoDB built on Node (using MongoJS), like so:
exports.saveToUser = funct… Read More
Mongodb finding results from sessions collection by custom id
Problem
I am using the Mongojs library which is thin wrapper around mongodb library. I want to do some find queries in sessions… Read More
Introduction to MongoDB GUI Tools
MongoDB GUI tool is a NoSQL database and is very popular for its convenience and features. No SQL (implies Non-SQL or Not only SQL) which means it is… Read More
Introduction to MongoDB tools
The following article provides you an outline of MongoDB Tools. As we know, Mongo is an open source NoSQL database, developed keeping in mind the high performa… Read More
Variables not updating correct in loop
Problem
I've been toying with node.js in coffeescript to pull some stories from reddit.com's json interface but running in to some snags.
I want to p… Read More
Why won't my express.js run?
Problem
I have an express.js app that get to this:
node app.js
info - socket.io started
And it won't get any further, if anyone can explain why this happens… Read More
Why is io undefined?
Problem
I have an express app using socket.io. I'm unclear on what is needed for the client to begin with, so I'd appreciate if anyone can show me how to do that. Addi… Read More
Mongodb's generated UID contain the word "bad"
Problem
Does anyone know what a "_id" generated by MongoDB ( or perhaps a Mongoose save ) means when it contains the word "bad" in the middle… Read More
MongoDB and MongoJS - can't get runCommand to work for text queries
Problem
My goal is to use MongoDB's (2.4.4) text command from Node. It works fine from the command line. Based on this pr… Read More
TypeError: Cannot read property '_id' of undefined
Problem
Hello Gurus of Node + mongodb,
I am getting error "TypeError: Cannot read property '_id' of undefined" on a simple post request t… Read More
Listen for "mongojs" connection errors
Problem
Mongojs is thin wrapper for mongodb-native library, but the only problem is that I am unable to listen for errors ?
The main errors which nee… Read More
Node.js requests randomly begin to hang and won't clear until server restart
Problem
I've been running into a really odd and seemingly random issue on our web app that I just can't seem to… Read More
mongodb shutdown option unavailable
Problem
My current problem: I have a production server and just updated mongod but lost some functionality.
In earlier versions (v2.0.6) I was able to r… Read More
Inserting the current datetime in mongodb
Problem
I have been having trouble inserting an actual datetime object in mongodb using the mongojs driver for nodejs. Any help?
var currentdate… Read More
Why my nodejs script didn't quit to shell?
Problem
My code looks like this:
#!/bin/env node
var collection = require('mongojs')('test').collection('test');
collection.findOne({}, functio… Read More
Node.js, socket.io and mongojs - Login form with socket.io
Problem
I am currently creating a small chat application on node.js using mongojs, I have a mongo collection of users with a usern… Read More
How do I get n set of documents in a sequential order Mongodb
Problem
I have my server with the route as "q=word/s=0/t=5" where q is the query string, s is the starting document and t is th… Read More
Introduction to MongoDB GUI
MongoDB GUI is nothing but the management tool which manages our database server, we can improve the productivity of our database server using GUI tools. Also, t… Read More
When you are developing a new app, the first step is to choose the right framework for the backend development of your mobile or web app. It is essential to select a framework that can provi… Read More