Currently doing a online course to learn some Node.js, Express, and MongoDB.
In this course there is a api section where they teach you to do simple stuff, but i ran in to an issue, the course video shows him updating name of an item, and the api…
I have 3 mongo server configured as replica set like this:
MY-PC:27017 -- Primary - DOWN
MY-PC:26017 -- Secondary - ACTIVE
MY-PC:25017 -- Secondary - DOWN
If 27017 and 25017 go down, how do you access data in sole-survivor, 26017 ? I found that…
I just started to learn mongodb. I tried the following code in my app.js
var databaseUrl = "localhost:27017/pixelmargin"; // "username:password@example.com/mydb"
var collections = ["pages"]
var mongojs = require("mongojs");
var db =…
I understand that a multi update will not be atomic and there are chances that the update query may fail during the process. The error can be found via getLastError. But what if I want to roll back the updates that have already been done in that…
I want to store objects like this with mongodb:
{
field: 'example',
attr: {
tmp : 'test',
tmp1 : 'test1'
}
};
Now I would like to search for the entry which has the property field:'example' and add a field to its…
My goal is to use MongoDB's (2.4.4) text command from Node. It works fine from the command line. Based on this previous SO issue: Equivalent to mongo shell db.collection.runCommand() in Node.js, I tried using MongoJS (0.7.17) but can't make it go. …
I'm writing a multiplayer game(mongojs, nodejs) and trying to figure out how to update user stats based on the outcome of the game. I already have the code written to compute all the post game stats. The problem comes when I try to update the users'…
i try to find a way to use vars for mongojs collections.
The data are dynamic and also the db.VAR.find(); must
be dynamic. Is there a solution for that problem. I
searched here and google, but there is nothing.
I hope you can help me.
Example:
var…
I am using mongojs together with nodejs and express. From so many online documents I only found find() save() update() methods. Is there a delete api ? If so, how to use it?
I am trying to remove one record based on _id which is auto generated by…
I want to populate data into a collection in mongo db. If I to hard-code the insert query, it would be as if:
db.devices.insertMany([
{"_id" : "FX200FTQ2109BZ00", "cloud_blueprint_id" : 105969, "cloud_blueprint_name" : "AWS-BP" },
{"_id" :…
I am trying to update multiple documents in multiple collections in a DB. While doing that Mongo throws an error after the first collection. And doesn't make changes on the after ones.
Error
Assertion failed: MongoError: Cannot use a session that…
I just want to know, what are differences of mongoose and mongoJS. And, what the advantage and the lack if we use mongoose or mongoJS ?
Because we know that are many depedency that use to connecting NodeJS and MongoDB. For example mongoose and…
Im quite new to node and mongodb, but im trying to write a simple API for a monitoring app. I can list out all aps fine through the /aps call, but /locations throws a:
process.nextTick(function() { throw err; });
…
I am creating REST api with hapi and mongojs. I need to output large number of JSONs as API response. I am using following code. But getting error “Error: Stream must have a streams2 readable interface”.
handler: function(request, reply) {
…
I have this admin panel template that's built in nodejs, jquery and angular.
I am trying to connect it to a mongodb to make simple CRUD operations.
I've installed mongojs via npm for this purpose but how do I take it from here? The Datebase itself…