Tagged Questions
0
votes
0answers
9 views
NodeJS MongoDB returns null docs reference on AppFog
Background
I developed an application using NodeJS, MongoDB and CoffeeScript. Locally it runs fine, but when deployed to AppFog strange things started happening. I was able to narrow down the issue.
...
0
votes
1answer
12 views
Express.js+MongodDB - where to define schemas and models [on hold]
I'm building an app with express and mongodb. My app.js file has become pretty huge due to all the schemas and models being in it, along with the routes. Any suggestions where to define my schemas and ...
0
votes
1answer
16 views
how to inc a value of a object every day in web application?
I am wrote a web application. Suppose there is many objects(stored in DB), I need inc or dec a value of it at the every 00:00.
And how to deal with it?
There is one way i am thought.
1. run a script ...
0
votes
1answer
13 views
nodejs/mongodb - reading out one specific element
I want to read out one specific element out of mongodb
db.collection('profiles', function(err, collection) {
collection.findOne({'email': mail}, function(err, item) {
this reads the whole entry
...
0
votes
1answer
36 views
mongodb json into json
Im trying to get a json obj into a json table (via node js)
in the end it should look like (2 layered object)
{
"Name": "bla",
"List": "bla",
"info": {
"info1": "bla",
"info2": ...
0
votes
2answers
22 views
Variable suddenly becomes undefined in the callback to an Angular $resource function
I'm building a function in Node that queries my mongoDB database and returns some results into an object. I'm having trouble getting the object set up correctly though. Here's my code:
Function to ...
0
votes
1answer
26 views
mongodb doesn't save all data
I need to insert some matrix in mongodb,so I wrote simple following code
var MongoClient = require('mongodb').MongoClient;
var matrisMaker = function(d1,d2){
var result = new Array();
for ...
0
votes
1answer
28 views
How do I update a subfield of which I know everythig, but don't know the field its a child to?
I have this collection:
{_id, list}
I have the elements in the list, of which each has an _id of its own, but I can't figure out how to update all the elements in the list. I do know that all ...
0
votes
1answer
49 views
How do you avoid a crash if someone tries to access a page without loging in?
Hey so when I try to go to a page that cannot be accessed without logging in, the app crashes. How do I avoid this? The reason why it crashes is because when they try to access that page, the page ...
0
votes
0answers
16 views
node + express + mongoose query authentification
Im building a simple web app app in express, and I'm a bit stuck in the authentification for my sessions, im going to validate everything in the client with backbone and regExp eventually when i start ...
0
votes
0answers
22 views
NodeJS/ExpressJS send response of large amount of data in 1 stream
I'm prototyping an app using the native mongo rest api where Node returns about 400K of json. I use the following to maket he request to mongo's native api and return the result:
...
0
votes
2answers
29 views
Async and recursion in nodejs
Beginning with express and mongoose i often need to do some batch operations on collections.
However it usually involves callbacks which is a pain given how concurrency is coded in nodejs.
so ...
0
votes
0answers
9 views
How to use read preferences in mongoskin?
Is there any way to define read prefence in mongoskin in collection or db level here is the sample from mongodb native nodejs driver
http://learnmongodbthehardway.com/ex22.html
var readMongo = ...
0
votes
0answers
30 views
How to configure mongoDB on a node.js application when hosting online?
So it's time for my node.js/express application to go live. It works fine at my local development environment. I'm new to both node.js and mongoDB. I decided to us nodejitsu as hoster.
The first ...
0
votes
0answers
23 views
Multiple views of the same database
I created a collection in the shell of MongoDB and inserted sample documents via shell. Then i inserted data via Node.js(using Mongoose). I queried the collection using node.js and recieved the result ...
0
votes
0answers
18 views
Using find() with geospatial coordinates in Mongoose (NodeJS+MongoDB)
Mongoose version: 3.6
Node version: 0.10
I have been trying to solve this problem for hours. I want to find all the documents closer than maxDistance to some coordinates. I am trying to use the ...
0
votes
1answer
27 views
Programmatically modify existing mongo document
Resolved, the issue was with the PUT request , I had to specify the header properly and go on with one at a time.
curl -X PUT -H "Accept: application/json" -d "prenom=Maxwell" ...
0
votes
2answers
18 views
Mongoose converting stored UTC dates to local time?
I'm wondering if this is normal, or if I'm missing something in the schema setup or query process:
My app, and mongoose, is correctly storing a date as UTC in mongodb. This is confirmed by viewing ...
0
votes
0answers
29 views
About Node.js and asynchronous mongoDB calls
I'm new to node.js and have a non-asynchronous background, thus this makes me feel stupid trying to understand how to properly implement trivial sync tasks asynchronously.
For example, I have an ...
0
votes
1answer
26 views
Error: connect EADDRNOTAVAIL while processing big async loop
I am experiencing a very strange problem. I am importing some big xml-files and store them into mongoDB. The algorythm is a typical async loop:
doLoop = function( it, callback_loop ) {
if( it ...
0
votes
0answers
21 views
info: [APP config] Database initialized: MongoError: auth fails
I am trying to connect my node.js application on AppFog to mongodb and get this error:
info: [APP config] Database initialized: MongoError: auth fails
here is my code utils/dbconnect.coffee;
# ...
0
votes
1answer
34 views
To to do a parallel “Query” in Mongoose
I am pretty new to Mongoose so please bear with me.
Is there a way to perform two queries in "parallel". Or at least query two documents and return their results together? The callback notation is ...
0
votes
2answers
28 views
Does Mongoose support the concept of a fixed queue array
I am looking to implement a time based queue with a fixed length where the old items pop off the back.
For instance I have a list of comments constrained to 10 items, the 11th item comes in and the ...
0
votes
2answers
46 views
Why is express telling me that my defualt view engine is not defined?
I'm using nodejs and mongodb in the back end for an app I'm working on. I'm using express to test the app, and I'm trying to use ejs to render my html files. However, I'm having the issue of my ...
0
votes
2answers
28 views
updating a live mongoose js application
I have a very basic question, I tried google but I cant really find anything.
I'm trying out mongoose js and I was wondering how you go about updating a live application.
Say for example I have ...
0
votes
0answers
21 views
Can I use a unique index on an array of sub-documents in Mongoose?
I want to prevent duplicate inserts of RecordLists, where two RecordsLists are the same if they have the same set of Records, i.e. the same array of sub-documents. This is the schema:
var RecordList ...
0
votes
1answer
40 views
NodeJS with MongoDB freezes at find() method
I am working on learning NodeJS by building a very simple pastebin. The code works as long as I do not try to persist the data with MongoDB.
The app freezes while trying to open the 'List All' page.
...
1
vote
0answers
37 views
Mongodb sharding dropping writes
I have a set of documents containing counters that are periodically incremented using an upsert $inc command.
I have several nodes as part of a sharded cluster.
With sharding switched off for the ...
0
votes
1answer
18 views
Querying with mongoose and dates
I'm trying to find out how to do an specific query with mongoose.
I have in mongodb something like this:
{ "_id" : 1, "modificationDate" : ISODate("2013-06-26T18:57:30.012Z") }
{ "_id" : 2, ...
0
votes
1answer
32 views
Mongodb duplicate key error. How do i get the error field from the error object as object?
When trying to enter a new document in mongo with a value on a field that already exist in another document i get this when i iterate through the error object:
for(var att in err){
...