Questions tagged [mongojs]

MongoJS is a Node.js package to access MongoDB.

References:

306 questions
0
votes
1 answer

Search MongoDB using a variable sent from client

I'm using MongoJS in a Node project with Angular and trying to find documents based on a variable. server.js app.get('/api/find', function(req, res){ db.Fruits.find({code:'Apple'}).forEach(function(err, docs){ res.json(docs); …
user1915190
  • 307
  • 1
  • 2
  • 14
0
votes
1 answer

Paging Large Datasets

I have a large collection of data that I want to write a script against to read then process; in my case grabbing some fields and sending to a RESTful API. To spare the load, I wanted to use limit and skip to paginate the data I retrieve and have…
Cole
  • 119
  • 13
0
votes
1 answer

Mongojs: findOne() doesn't work

I was trying to use findOne method. But it didn't show anything.It looks like it didn't execute. Would you like to help me solve this problem? var mongojs = require('mongojs'); var databaseUrl = "mongodb:local:27017/mydb"; var db =…
Irene Liu
  • 17
  • 1
  • 3
0
votes
1 answer

Unknown FIND processes running in UBUNTU

I have been seeing tons of these FIND process. I am running nodejs with express and trying to poke the web service using POSTMAN. I have no clue what triggers these processes and this thing is slowing the server down. While it does say something…
summerNight
  • 1,446
  • 3
  • 25
  • 52
0
votes
1 answer

MongoJS - No Error On Unique Index

So I'm messing around with MongoDB using MongoJS and can't seem to get an error to be returned when a unique ID exists. So this is the code I am using: server.post('/register', function (req, res, next) { var details = req.params; …
Tenatious
  • 849
  • 4
  • 12
  • 32
0
votes
0 answers

Can not connector to replica set with Java driver, works with Node.js driver

Here is how I connect to my replica set with Node.js: var MongoClient = require('mongodb').MongoClient; var url = 'mongodb://ec2-54-237-60-17.compute-1.amazonaws.com:27017/test?readPreference=secondary'; MongoClient.connect(url, function(err, db)…
mravey
  • 4,380
  • 2
  • 21
  • 31
0
votes
1 answer

passing variable to mongodb

In case anyone else reads this, I've answered my own stupid question. The problem was that I was storing the value as an integer, but searching for it as a string. Pro tip: Store stuff as string values or; When querying for a integer, while using a…
David
  • 2,094
  • 3
  • 30
  • 47
0
votes
0 answers

Cannot call method 'find' of undefined when running in nodejs

I'm using mongoDB(mongojs) and nodejs. When I run my server.js I get the following error. TypeError: Cannot call method 'find' of undefined I do not know why is this happen.This is my server.js: var express = require('express'); var app =…
QWERTY
  • 263
  • 2
  • 6
  • 21
0
votes
2 answers

mongodb update and/or change an array key without using the value

I'm having trouble removing/renaming an array object from my mongodb. { "_id" : ObjectId("556a7e1b7f0a6a8f27e01b8a"), "accountid" : "AC654164545", "sites" :[ { "site_id" : "example1.com" }, { "002" : "example2.com" },…
David
  • 2,094
  • 3
  • 30
  • 47
0
votes
1 answer

Mongojs attempting to push to array

I'm trying to keep a list of all the sites I'm working on right now, and I'm having issues using $push. I've created a document with this: accountData = { 'accountid': account_id, sites: { '001': 'example.com', …
David
  • 2,094
  • 3
  • 30
  • 47
0
votes
0 answers

Angular subtracting from an integer in database

So i have a full on application here is a run down: …
Gianni
  • 136
  • 1
  • 14
0
votes
1 answer

Count total items in mongoDB collection/database

I can't seem to find the answer to this. I wan't a simple return statement of the amount (total) items in my collections. var mongojs = require('mongojs'); var db = mongojs("myadb",['myadb']); db.myadb.count(function(used,a){ …
Kivylius
  • 6,357
  • 11
  • 44
  • 71
0
votes
1 answer

Integration testing with mongojs to cover database errors

I'm working with mongojs and writing tests for mocha running coverage with istanbul. My issue is that I would like to include testing db errors. var mongojs = require('mongojs'); var db = mongojs.connect(/* connection string */); var collection =…
hg.
  • 324
  • 1
  • 13
0
votes
1 answer

Nodejs mongojs install error

I'm having some problems installing mongojs via npm. Whenever I try to install it (on windows 8) I just get a page full of red errors. There's so many of them that I don't even know where to begin, heres a sample of them (this is maybe 1/10 of total…
Simon
  • 9,762
  • 15
  • 62
  • 119
0
votes
2 answers

Mongojs find by uuid _id

I am trying to find one record with "monogjs" by _id. Our _id is a guid (.net). So I have something like this "80cd95b8-79bf-4025-933b-cabc71fbdc9f" as a string. Now I tried "monogdb.bsonpure" with a "buffer" specifying the subtype of uuid. I tried…
Pintac
  • 1,565
  • 3
  • 21
  • 38
Photo Item Name Price Quantity