mongojs Questions

5

Solved

I am getting error "TypeError: Cannot read property '_id' of undefined" on a simple post request to save a document to the collection called books, My payload looks like this: { "name": "practica...
Faunie asked 30/8, 2013 at 22:25

2

Solved

I have a document "owner" that can have "n" number of camps and camps have "instructors" and instructors have "classes". Earlier I tried accomplishing this with nested arrays (see link to my post b...
Fabrianne asked 25/6, 2013 at 2:58

4

Solved

I'm having trouble getting mongodb data into nodejs array as follow: Test db: { "supportTicket" : "viT8B4KsRI7cJF2P2TS7Pd0mfqaI5rtwf", "msgId" : 1379304604708.0, "username" : "Guest-OSsL2R", ...
Garrard asked 16/9, 2013 at 7:26

2

Solved

I have 2 mongo instance running in 2 different servers (one primary and other secondary); I am able to retrieve a document from the primary server using this connection code: var db = mongojs('use...
Juncaceous asked 29/9, 2016 at 11:36

2

Solved

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 ...
Ondrea asked 27/8, 2013 at 0:43

3

Solved

Using NodeJS + MongoJS, I have connection to a mongo DB. I set a TTL on a collection with: myCollection.createIndex({createdAt: 1}, {expireAfterSeconds: 60 * 30}) Is it now possible to update t...
Mayemayeda asked 9/3, 2015 at 10:35

2

Solved

I have a collection like this: { 'datetime': some-date, 'lat': '32.00', 'lon': '74.00' }, { 'datetime': some-date, 'lat': '32.00', 'lon': '74.00' } How can I get the latest record from Mon...
Organic asked 23/2, 2014 at 17:28

2

I've got the following doc in my db: { "_id": ObjectId("ABCDEFG12345"), "options" : { "foo": "bar", "another": "something" }, "date" : { "created": 1234567890, "updated": 0 } } And I wa...
Astrophysics asked 24/1, 2017 at 7:40

3

Solved

Major Questions Currently I'm very confused, the main questions are: What is the use of Mongoose/Mongojs? What would be different if I run Node.js without Mongoose/Mongojs? I can't find any good ...
Giraud asked 4/5, 2013 at 23:48

2

Solved

Hi I am trying to use the Async module to retrieve two users and do some processing after they have both been retrieved however I keep getting the error message: Callback was already called. Below ...
Terpineol asked 17/12, 2014 at 8:47

4

Solved

Does anyone have a good approach for a query against a collection for documents that are older than 30 seconds. I'm creating a cleanup worker that marks items as failed after they have been in a sp...
Exceeding asked 5/2, 2014 at 23:47

1

Solved

db.movies.find({"original_title" : {$regex: input_data, $options:'i'}}, function (err, datares){ if (err || datares == false) { db.movies.find({"release_date" : {$regex: input_data + ".*", $optio...
Velda asked 6/8, 2015 at 15:26

1

Solved

I'm new with nodeJS and MongoDB. I have this code: var fs = require('fs'); var mongojs = require('mongojs'); var db = mongojs('monitor', ["configurations"]); fs.readFile('json/object1.json', 'utf...
Ferrel asked 29/6, 2015 at 7:11

1

Solved

I've run into a situation where I need to dynamically update the value of a field in a subdocument. The field may or may not already exist. If it doesn't exist, I'd like mongo to create it. ...
Cicala asked 27/7, 2014 at 21:53

2

Solved

I am trying to delete records based on ID. I am sending the ID via the get verb and acessing it from req.params.id. My code isn't working. What am I doing wrong? //delete user router.get('/deleteu...
Supplication asked 15/6, 2014 at 19:56

2

Solved

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 whe...
Uraeus asked 8/6, 2013 at 18:46

2

Solved

I'm using mongojs and I'm trying to iterate over all elements in a collection index = 0 db.keys.find({}, {uid: 1, _id: 0}).forEach((err, key) => if err? console.log err else console.log (...
Peckham asked 13/6, 2014 at 23:20

2

Solved

I'm writing an application where I use express, Node.js and MongoDB (using mongojs). I have a module db.js and a server.js, which have the snippets below. db.js var getUsersByCity = function(city...
Mammiemammiferous asked 13/5, 2014 at 22:15

1

Solved

I have been having trouble inserting an actual datetime object in mongodb using the mongojs driver for nodejs. Any help? var currentdate = new Date(); var datetime = currentdate.getDate() + "/" ...
Indonesia asked 26/10, 2013 at 21:55

1

Solved

I'm trying to add an "Instructors" array into an already existing "Camps" array. The hierarchical structure looks something like this: owner = { email : '[email protected]', password : '...
Allomorph asked 24/6, 2013 at 2:23

1

Solved

Presently being driven up the wall by this error. I am running a node.js app with the mongojs wrapper for mongodb. I Started mongod on the default port, then ran var db = require('mongojs').conne...
Hypergolic asked 20/8, 2012 at 0:23

2

Solved

I would like to be able to query my mongoDB and display this result on my web page made with Node...right now I am using the mongojs driver - I've found the driver very very good for putting data i...
Isolationist asked 21/5, 2012 at 17:50
1

© 2022 - 2024 — McMap. All rights reserved.