Questions tagged as 'express'

2
answers

Search for text with mongo in several reference collectionsj

As mongodb does not support join and I have the need to search several collections of businesses, services, and users, I have arrived at a solution but I need to be validated and / or improved. The flow of the scheme would look like this: B...
asked by 11.02.2017 / 05:46
1
answer

Using Node, Express and Multer to upload a file to MongoDB? What should I use, Multer or GRIDfs?

Hi, I'm running a final project in Heroku using MongoLab and Multer to upload photos, it seems to work fine, but after a few hours or less the photos disappear from the page, but leave the img placeholder, the symbol appears when the browser can...
asked by 20.01.2017 / 18:10
1
answer

fill variables with express middleware js

I'm trying to fill a variable with a middleware that receives information through a request json and I'm storing it in a global variable which I later use in a render with pug, but the first loads return an empty variable, How can I ensure that...
asked by 20.01.2017 / 16:34
2
answers

Execute a node script indefinitely to query a DB?

I have some nodejs scripts to query a mongo Db, but what I want is that this script is running indefinitely, maybe with a 5 minute sleep, and if it stops there is another script that he "revives" him. Any ideas on how to do these processes? I...
asked by 02.12.2016 / 18:57
1
answer

undefined id in my middleware

Edit: what the middleware does takes the url part of the id and uses it to search the database for a special record but tells me that the id in the find_image.js is undefined so I guess it does not is passing the parameters to the middleware....
asked by 18.07.2016 / 20:21
1
answer

Using CO in node with node-mysql

I would like to know if someone can help me with the use of CO in node using node-mysql to build queries where one depends on the result of another. This is the same as using async / await but without needing Babel. I'm trying to do a function w...
asked by 22.11.2016 / 20:09
1
answer

middleware continues after the next

I have the following question with a middleware, if the middleware works the following way: function middle(variable){ // codigo codigo return function(req, res, next){ if(hrk !== 'jfk'){ if(variable){ next(); }...
asked by 08.03.2016 / 20:03
1
answer

Mongodb and dates

I have a problem, when I save a date, it is saved like this: 2018-12-04T00: 00: 00.000Z and I would like the time to be 23:00 not 00:00 2018-12-04T23: 00: 00.000Z It's an api, with express and node function SaveOfferDay(req, r...
asked by 04.12.2018 / 10:21
1
answer

Insert a sub-document into a Mongoose sub-document

I currently have an object like this: { _id: 5ab5051ec97a4202984f2973, student_code: "1234567890", name: "myname", lastname: "mylastname", areas: [] } With mongoose I can insert a sub-document in areas like this: .post(fu...
asked by 23.03.2018 / 15:23
3
answers

MongoDB. Is there a way to relate collections?

I am working with a CRUD app with the MEAN stack to keep track of patients, I have a requirement to add a medical history to the patient with the particularity that when you delete a patient, only the patient is deleted, and your medical history...
asked by 25.08.2017 / 23:47