Questions tagged as 'node.js'

1
answer

GET FORM DATA JS [closed]

So I wanted to do the following has a form that has multiple input fields, so I wanted to do the following loop or something like that to get the values of the fields using jquery or js (pure) / p> I'd like to know one way to do this     
asked by 30.07.2018 / 13:57
1
answer

Remove duplicate characters in string if it is not a digraph

How to remove duplicate characters in a string, if not a digraph (rr, ss) using Regex? Ex:    Oiiiii = > Hi       Aloooo = > Alo       Past = > Past       Carroooo = > Car If rr or ss appears at the beginning...
asked by 21.04.2018 / 20:56
1
answer

The updateOne function is not working, it returns OK but does not change anything

I'm using MongoDB to do data persistence in my application, with NodeJS. I make the call like this: module.exports = function (app) { var dbConfig = app.config.db; return { changeAccountStatus: function (request, response,...
asked by 08.02.2018 / 18:48
2
answers

How to assign the callback variable "cursor.toArray (err, doc)" to an external variable?

var result = []; var user = db.collection('user'); var cursor = user.find(); cursor.toArray(function (err, doc) { result = doc; }); console.log(result); // console -> []     
asked by 10.12.2017 / 16:31
1
answer

How do I put an application to run in the background when it's closed?

I'm creating an application on Node.Js using Electron and needs to continue running in the background when it's closed, and becomes an icon for the next application to the computer's clock for the user to access. But I did not find referen...
asked by 06.11.2017 / 13:43
1
answer

List all states in the JS and Mongo Node

I'm trying to assemble a function to list all states and then print inside an object. Sorry to be so noob, I think it's a pretty silly problem. States function listarTodasOsEstados(){ var estado = [ 'AC', 'AL', 'AP', 'AM', '...
asked by 28.10.2017 / 20:30
1
answer

Terminal Git vs Terminal Node vs Windows Terminal

I'm having a hard time noticing the need to have so many terminals installed on my computer when I need to use git or node.js. What are the differences between the terminals, what can one do and the other not? For example: I wanted to check if I...
asked by 05.01.2018 / 17:02
1
answer

Node js problem fetching function value

I have the following structure on node: module.exports.find = function(pesquisa,frase){ return new Promise((resolve,reject) => { pesquisa.find(frase, function(err,data){ if(err) throw err;...
asked by 01.10.2017 / 22:37
1
answer

Remove timezone on request with node.js and express.js

I have API with node.js and express.js . In the database the fields of type datetime are saved correctly, but in the response of a request GET the date fields come with 3 more hours due to the time zone. I am...
asked by 02.10.2017 / 16:53