Questions tagged as 'node.js'

1
answer

How to change a record in Mongo through a function and update node?

I have a problem. I have a data set inside Mongo, a json that was returned from a request from url pa/ with app.get('/pa', function (req, res) { paController.list(function(resp) { res.jsonp(resp); }); }); similar to t...
asked by 04.08.2016 / 22:13
1
answer

Field "__v" in all documents in a collection

All my documents in a MongoDB database have a __v field, what does it mean? > db.speeds.find({}).limit(2).pretty() { "_id" : ObjectId("586826f700890738a5e8cb3d"), "remoteId" : 1, "first" : ObjectId("586826f700890738a5e8cb...
asked by 31.12.2016 / 23:03
1
answer

Convert date and time to numeric value in JavaScript

I saw in kibana , the dates are treated as numeric values, for example, the date: 2016-05-03T10:00:00 is equal to the numeric value: 1462280400000 . I would like to understand how this works, and what function it can convert.     
asked by 03.05.2016 / 15:26
1
answer

Use if () inside .catch () - error: unexpected token if

It is as follows I'm new to javascript and I'm not sure how to handle this error. I'm trying to call a function and putting a .catch() to avoid the error UnhandledPromiseRejectionWarning shortly after it, but I would like to check...
asked by 25.01.2017 / 23:52
1
answer

Integrate nodejs (frontend) and C, Erlang, Go ... (backend) [closed]

I have a system to be developed that will need to handle a large number of simultaneous requests, where each of these requests will probably involve some task that requires a lot of processing. By researching how to deal with this situation I ca...
asked by 09.03.2016 / 21:37
1
answer

What is Node.js and what does it replace?

What node.js is what anyway? He substitutes who? JavaScript? ServerSide? Can anyone explain me better? I did not find the questions on the Web directly.     
asked by 19.03.2016 / 02:49
2
answers

Error encountering NodeJS module

I'm following a book of NodeJS and it's giving the following error: Error: Cannot find module './app/routes/home' I have reviewed several times and found nothing wrong, here is the code: Express.js // config/express.js var expre...
asked by 24.08.2015 / 22:36
1
answer

Thread in Java and NodeJs

We know that benchmarks are specific measures and do not count for all cases, certainly what and how you measure matters a lot, so I'll try to be very specific. In the case of a server having thousands of connections, and if it is a thread ru...
asked by 17.08.2015 / 22:20
1
answer

NodeJS socket client - callback for each request

I have the following code var net = require('net'); var client = new net.Socket(); client.connect(1337, '127.0.0.1', function() { console.log('Connected'); client.write('Hello, server! Love, Client.'); }); client.on('data', function(...
asked by 11.07.2015 / 05:29
2
answers

Block saving of repeated data

How do I check the controller, if an email already exists in the mongoose database and thus, does the lock save it again?     
asked by 10.07.2015 / 22:07