Questions tagged as 'nodejs'

1
answer

Insert users in a select

I have this query getAnalisisDetalladoSelect: function(req, res, next){ sql.connect(config) .then(function() { var usuarios = null; var request = new sql.Request(); request.qu...
asked by 23.06.2017 / 21:53
3
answers

'Can not read property' length 'of undefined' nodeJS

I have this query getAnalysisDetailed: function (req, res, next) { var config = require('.././database/config'); sql.connect(config).then(function() { var articulos = null; var request = new sql.Request(); request.query("SELECT...
asked by 22.06.2017 / 15:26
1
answer

Error executing hello world in node

Good a query happens that I installed node with installer in my pc, but when I execute it does not respond any idea? here my script to explain me better var http = require('http'); var manejador = function(solicitud, respuesta){ console.l...
asked by 05.09.2017 / 19:04
1
answer

Menu nav single page

I have this menu in nodejs (jade / pug) extends ../templates/default block content nav#colorNav ul li.green a.icon-home(href='#') ul li a(href='#') Generar li...
asked by 06.06.2017 / 19:21
2
answers

Sort array by two properties (JavaScript)

I have an array with objects that have the following format: { "username": "Antonio", "bot": false } I currently have the following code: guild.members.sort((a, b) => a.user.username > b.user.username ? 1 : -1); In which, sor...
asked by 16.05.2017 / 10:57
1
answer

Error getting query in node.js

I am making an agenda for myself (without any security). To add, delete or update I use GET to notify the server that I am adding a task. The address would be this:    link Afterwards, to get the query in node.js, I use this code: i...
asked by 05.09.2018 / 00:20
3
answers

Get values from a JSON in node.js

I'm having problems with this code in Node.js. I need to get the information found in "Contents" of the JSON but it gives me an error that says: "e.Contents.forEach is not a function" I guess it's a logical problem but I honestly do not know n...
asked by 06.09.2018 / 18:11
3
answers

Using findOne () and findOneById with HTTP requests (Nodejs + mongoose)

I'm doing a api rest where I want to do HTTP requests using Postman, specifically I want to do a search or update a mongodb document, but this must be by an id that is not the doc_id that mongo provides. Basically what I need is for someone t...
asked by 14.04.2017 / 20:27
1
answer

Convert a string type date to the MongoDB ISODate format

I need to store the dates contained in a JSON object in a format that assures me that it will be valid in any scenario that is used and the chosen format is ISODate. Initially I tried to create an object Date() and function .toISOSt...
asked by 27.04.2017 / 04:17
1
answer

Modify a field of all documents

Greetings, I have a question about the update method. TablaPTC.update({compGasto:"si"},{$set: {acumulado: "0"}}); Currently this is my method, and I'm not sure I have to change it to serve.     
asked by 17.01.2017 / 04:54