I have a lot of data to fetch from a mongodb database. I can't load all the data at once on the server because it's too big and I would run out of memory.
If I use forEach, will it fetch everything and load everything on the server then apply the…
I have a MongoDB 2.6 database.
From the mongo shell, I am able to perform bulk operations as expected, and using the Mongo 1.4.9 node driver as well:
// bulktest-mongodb.js: works fine
var Db = require('mongodb').Db;
var Server =…
I was trying out mongodb and nodejs on openshift, using mongojs to interface between nodejs and mongodb.
In mongoshell I ran "use nodejs" and defined a "scores" collection. I saved some data in it and its correctly showing.
In app.js file of…
In my project I need to find the most recent document in collection. I created one but it dose not return anything and I don't where is the problem exactly. Can you help me?
Function:
DBManagerConnection.prototype.findDeviceLastDeviceActivity =…
I'm trying to learn node, mongodb and mongojs and have a newbie question.
My route looks like this ...
server.get({path: PATH + '/:author', version: '0.0.1'}, msg.findMsgsByAuthor);
My JSON looks like this ...
{
"parentId": "1234",
…
I am running node.js with mongoDB with mongojs as driver.
I have the following issue,
I try to query business collection with _id array, if I try to build the query dynamically as below, I get array with length 0 back which is wrong.
…
Hello Stackoverflow community,
I'm new to Node.js / express and i need your help because i stuck at some problem.
I'm trying to make a registration process where the Post inputs are saved into a mongodb.
Before i wanna validate if the users email…
I have created two shards,and applied sharding to the collection posts whose details are as:
sh.status()
--- Sharding Status ---
sharding version: {
"_id" : 1,
"version" : 3,
"minCompatibleVersion" : 3,
…
I have a collection having following data:
{"_id" : ObjectId("5220222f8188d30ce85d61cc"),
"testfields" : [{
"test_id" : 1,
"test_name" : "xxxx"
}]
}
when I query :
db.testarray.find({ "testfields" : {…
I have a document with the following structure
{testfields:[{"test_id":1,"test_name":"xxxx"}]},
but , my application don't no whether "testfield" is array or plain object, now if I apply "$unwind" in aggregate query and filed is not of array type…
I'm trying to $push an item into my record in MongoDB built on Node (using MongoJS), like so:
exports.saveToUser = function (req, res) {
console.log("IN");
var user = req.params.user;
var param = req.params.param; // equals "foo"
…
OS: Windows7
I installed mongojs using the "npm install mongojs" command. Now, how do I open the mongo.js editor using node.js or cygwin?
I googled and youtubed this all day and it seems like a taboo subject. I've successfully created mongodb…
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 whether there is an equivalent to runCommand() function…
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.
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 database. The update is working fine but the control does not return.
var fs = require('fs')
var…