Questions tagged as 'nodejs'

2
answers

Use error handler or extend objecto response in express

Good morning, I am doing a REST API project using Express and with the intention of refactoring the code to return the client an error response I do not know which of the following options is more efficient: Use a bug handler as specified i...
asked by 24.10.2017 / 23:37
1
answer

Error in Cast to ObjectID

Good morning: I start from the following scheme: var schema = new Schema({ id: { type: ObjectId }, title: { type: String, required: [true, 'Title required'] }, students:[{ id : ObjectId,...
asked by 19.10.2017 / 14:01
0
answers

How do I get access to install modules?

I want to install a node module globally in windows and the following happens to me: and then this appears in the vsCode:     
asked by 17.10.2017 / 03:30
0
answers

Error Cross origin requests

Trying to consume a service through a web app that I have hosted in heroku , I think the following error: Failed to load localhost:3000/posts/1: Cross origin requests are only supported for protocol schemes: http, data, chrome, chrome-extensi...
asked by 13.10.2017 / 02:51
1
answer

Problem receiving data on a promise

I ask this question because I have a problem when it comes to receiving some data in a promise. return res.status(200).send({message: 'Se ha subido el archivo de video satisfactoriamente.', video: updatedVideo, file_name: file_name}); That'...
asked by 09.10.2017 / 14:12
0
answers

Nodejs and MySQL: LOAD DATA INFILE sends error "No such file or directory"

I want to do a LOAD FILE from Mysql from Nodejs but I get an error { Error: EE_STAT: Can't get stat of '/var/www/node/importacion/api/csv_files/bulk_for_mysql_410201713121.txt' (Errcode: 2 "No such file or directory") My script is as follow...
asked by 04.10.2017 / 20:57
1
answer

How to create a query to two different tables and render them in the same view with Node js Express

Good afternoon, my name is Diego Castaño, I am new to this community and I need a favor from some of you. In a view (vConfExit.jade) I have two select and I need to fill them with two different tables that I have in a database, I have managed...
asked by 23.11.2017 / 20:48
2
answers

Problem retrieving datetime

I have a problem retrieving the dates in my Rest API. I insert a data and the datetime is automatically filled in my BD. for example. 2017-09-27T23:16:46.000Z this value that is generated automatically and I can see it with mysql wo...
asked by 28.09.2017 / 00:40
0
answers

Return variables callbacks and how they are stored in a global variable for validations in sql

I am starting in programming with NodeJs and I have a little problem. I'm doing validations for registering new users on a website. And I'm doing the validation modules so that a certain field is not duplicated. //main.js var mysql=...
asked by 27.09.2017 / 18:05
1
answer

Nodejs and Mongodb: How to iterate a find () response

How do I iterate over a find answer on Mongodb in Nodejs? I have the following code: ConectarMongo() .then( function( db ){ var colClientes = db.collection( "clientes" ); var datos = colClientes.find({estado: "nuevo"})...
asked by 04.10.2017 / 02:08