Questions tagged as 'node.js'

1
answer

String for an array inside a loop - javascript / nodejs

I want to pass the strings of a txt file to an array and as soon as each line was passed to the array the program would run it normally, then it would repeat and pick up the second string from the txt file. Everything is being done in javascript...
asked by 10.09.2017 / 14:42
1
answer

How to transform mail object into Stream, Buffer or String?

I'm doing an email application and my server is being done in HapiJS, and I'm having trouble picking up the email and turning it into a String, Buffer, or Stream. I want to transform to these formats because they are the only ones that MailP...
asked by 28.08.2017 / 21:10
1
answer

Node.js for relaying information from a third-party API

What I want to do with Node.js is basically LISTEN to an API (jSON) and process the results to send to multiple clients. Example: WhatIwanttoknowis:DoesthisMyVPScomputerhavetoexistanywayandruntheserverapplicationfor24hours?Ithoughtofsomet...
asked by 26.08.2017 / 09:21
1
answer

MongoDB - Filtering returns

I would like to know how I can be filtering the results returned in my mongodb queries in this scenario, I will have to return the sector names and contacts for each sector from the company ID, but I would like to return only those records that...
asked by 04.09.2017 / 14:35
1
answer

Problem getting user data on location ApplicationStorage

I would like to implement a menu "my account" in my project, this menu should show user data such as name, email etc, I am using jwt and the logged user data can be obtained in LocalStorage in this format: {"id":"598a8bc8b9dd44250819a7c4","name...
asked by 12.08.2017 / 23:06
1
answer

Node.js - Aggregate object returns

I'm locally doing the Node.js exercise as MongoDB proposed at link There are two collections, orders and product . After aggregation, the expected result would be: [ { _id: 1, product_id: 154, status: 1, orderdetails: [ { _id:...
asked by 09.09.2017 / 02:52
0
answers

Data + duplicate Images upload on nodejs!

I'm starting now with NodeJS, and I'm testing an example that saves data along with an image upload. It is working, but the image is duplicated. I wanted to know where the error is, and why: var express = require('express'); var app = ex...
asked by 08.09.2017 / 23:04
2
answers

Remove an object inside a mongodb array

I have the following document inside a collection in mongodb: { "_id" : ObjectId("5988efbb742568478c6a086f"), "cliente" : "[email protected]", "lista_compras" : [ { "id_produto" : ObjectId("5983bb21834000b1b8...
asked by 09.08.2017 / 01:09
1
answer

npm ERR! missing script: start

I'm having this error while trying to start a vue-cli. The installation ran smoothly: villas:vue villas$ npm start npm ERR! missing script: start npm ERR! A complete log of this run can be found in: npm ERR! /Users/villas/.npm/_logs/2017-...
asked by 25.08.2017 / 02:47
1
answer

Mongooose Middleware to encrypt password in Schema

I'm having a hard time getting a Middleware in my schema with mongoose. I put it as save and I'm getting the error that it is not a function when I call it. See below both codes: schema.pre('save', function(next) { console.log('this gets prin...
asked by 24.08.2017 / 19:53