Most voted "node.js" questions
Node.js (or commonly Node) is a Javascript Runtime created with Chrome’s Javascript V8 engine. It allows you to run Javascript code without the need for a browser, raising the privileges to those found in other desktop languages. It is a technology strongly focused on non-blocking programming of I/O operations, which makes it very efficient for these operations.
Learn more…2,679 questions
Sort by count of
-
0
votes1
answer80
viewsTesting a cron-job with JEST
I have a javascript class that contains a function which initializes a cron job. To perform cron-job I used the Node-Cron library. But I can’t find a way to test the class and function. The…
-
0
votes1
answer114
viewsProblem with Relationship Sequelize
I have two tables called type_agricultural_implement and agricultural_implement, in which the id of type_agricultural_implement is inside the table agricultural_implement as…
-
0
votes1
answer31
viewsHow to insert a datum with relationship in the bank with prism 2
hello, I am trying to create a record in my database, I need to enter the information of a Mikrotik but I have to relate the table of the mikrotiks to a table of subnet, when I create the Mikrotik I…
-
0
votes1
answer202
viewsHow do I use variable value outside of your callback? Javascript
I’m trying to get the HTML of any URL (Google for example), to use it in my front end. First, I try my server.js Node with Express to get this HTML through the "request module":…
-
0
votes1
answer15
viewsHow to pass arguments on a stored procedure in Mysql?
How do I pass these arguments inside CALL? When I put 9 random values inside LET sql("..."), it runs, but passing this way returns this error. I followed this tutorial ->…
-
0
votes1
answer63
viewsPerform OR operation between two models in Sequelize
In my Proposal table I have two Foreign Keys that reference the same table(Producer), I need to make a Where to check if there is a producer with a document equal to the searched in one of these…
-
0
votes1
answer50
viewsHow to create a test for a function with a service inside?
I have the code below and managed to create a test for it, when it enters error 400 and 200. However, I can’t get the test to enter the catch. I’m using Mocha and Chai. myController.approve =…
-
0
votes1
answer46
viewsHow to create triggers in Firebase functions
I’m working on an application that needs to receive a notification whenever a client opens a request, but I’m not able to create a Rigger so that whenever a new document is opened Firebase will run…
-
0
votes0
answers39
viewsCapturing except for routes on express
I write an application with Express and Typescript, and to capture the exceptions of the routes I do so: index ts. // ... app.use(userRoutes); app.use(handleError); // ... having 'handleError' in a…
-
0
votes1
answer481
viewsCreate JSON files relating arrays
I have two json files, one with id, status and acronym and the other with the state id and the cities of that state. I read these files and recorded the content in arrays, but I need to create a…
-
0
votes1
answer390
viewsRecognize Provider error (Node.js, Typescript)
I am having a problem sending a request, which comes out of my Typescript file, I send it to Insomnia and generates the error only after sending. Typescript file : import { Router } from 'express';…
-
0
votes1
answer41
viewsCreating Crud in Nodejs Error in the post
const users ={ nome: String, idade: Number, saldo: Number, aposta: ()=>{return dados} }; const dados = { gama: String, investimento: Number, lucro: Number, totalRetorno: (investimento, lucro)…
-
0
votes1
answer94
viewsHTTP request using RAW/JSON Angular 7
Good afternoon, I’ve tried almost everything but I can’t do a POST at the angle using a list, always returns error 500. This is the Component call. ngOnInit() { let CSVProduto:…
-
0
votes1
answer140
viewsIntersection of 2 arrays with objects and arrays in object property
Summarizing , I put in String format to illustrate here. I have an array as follows : "[{"cp_57b326e91ac094817aaf37f2":"1.Folha(Ponto)"}]" And I also have the following object array…
-
0
votes0
answers35
viewsBackground routine for data compilation is a good idea?
The last company I worked for had some very peculiar rules, these not being as common (as far as I know) in other IT companies. Basically we compiled all the data that would be used in the system…
-
0
votes0
answers30
viewsObject attribute can be filled with function call? Javascript
I’m trying to turn a file. js in module so I can access it in another .js. So this file I want to export needs to be it integer an object, right? Example: File "database" module.exports = {…
-
0
votes1
answer38
viewsSet value in the textarea (Tinymce) by clicking on the table line
Come on, guys, I need a little help here... I am using the Tinymce plugin in a textarea element of my application Node.JS, I wanted to know how to set a text in this element, this text is coming…
-
0
votes1
answer333
viewsHow do I put more than one filter in my search for a get?
I am using mongodb and Node. In the code below I am only searching for an 8 digit code, but I wanted to put also a search by name, as I do? exports.getByCode = (req, res, next) => { Roles…
-
0
votes1
answer145
viewsKNEX: How to create an array from the result of the query in Sqlserver?
I am using the Knex to make a query that united several tables from a bank Sqlserver (use two version of Sqlserver 9.0.3042 and 12.0.5000.0), example: knex('tabelaA') .join('tabelaB',…
-
0
votes1
answer348
viewsSELECT sequelize
I’m getting the error: (Node:20796) Unhandledpromiserejectionwarning: Typeerror: _Accessojs2.default.query is not a Function, I have the database configuration file: import Sequelize from…
-
0
votes0
answers23
viewsnodejs - http/https request asynchronous
I am trying to assemble a module containing a function of http/https request based on the URL informed, but in the main module I get no output. get js. const https = require('https') const http =…
-
0
votes2
answers70
viewsWhich files should be ignored by Git in a Mongodb database?
I am creating an application with Mongodb and after initializing the repository, I entered the command git add * in the root directory of my project. When I went to upload the repository to Github,…
-
0
votes1
answer428
viewsGet url of route accessed in Nodejs
I need to know which external url the user accessed on my server. My script works well when the route is "localhost", but it doesn’t work to know what the url is when the domain is not the same as…
-
0
votes0
answers87
viewslist of users socketio nodejs
I’m using the following scripts below to store a list of users who are logged in to the chat I’m doing in socket.io and nodejs, but I wanted to store more than one object, in case I’m only able to…
-
0
votes1
answer323
viewsHow to pass several parameters to query in Mongoose?
I want to do a Mongodb search with Mongoose (Nodejs), where I want the objects whose url attribute that is a string contains within it at least 1 of the values I have in an array. How could I do…
-
0
votes1
answer568
viewsError: Nodejs, javascript "belongsTo called with Something that’s not a subclass of Sequelize.Model"
I am trying to use belongsTo function and get this error. Connection DATABASE has been established successfully. (node:14119) UnhandledPromiseRejectionWarning: Error: User.belongsTo called with…
-
0
votes1
answer123
viewsTypeerror: Contacts.map is not a Function
Hello, I searched on the subject and saw that it may be an error that may be due to not receiving an array. However, I put to be returned an array in the API, can be consulted here…
-
0
votes1
answer48
viewsSelect in NODE returns empty
When I run this query: SELECT xml_nfe FROM NDD_COLD.COLD_PROD WHERE ide_id ='NFe42200602831172001104550000010390091233318028' In plsql it returns me a line with information, then I pass the same…
-
0
votes1
answer80
viewsElectron Node import returns "Undefined"
I want to use Electron with Node, but when importing this framework following the step by step of tutorial of the site, it always returns undefined. // Abaixo tanto o "app" quanto o "BrowserWindow"…
-
0
votes1
answer140
viewsHow to Query Table Too Much for Many Knex
I’m trying to do a query in a relation many to many, but it’s not going well as I expected... the method I did was like this: const getAll = async (req, resp) => { knex({ pc: 'product_category'…
-
0
votes1
answer69
viewsError when trying to implement Swagger in my API
Good evening, I am trying to implement Swagger in my api however it is presented the following error in my console (node:28024) UnhandledPromiseRejectionWarning: AssertionError [ERR_ASSERTION]:…
-
0
votes1
answer65
viewsHow . populate searches the data
I have a question about performance using Mongoose. Suppose the following models: const Disciplina = new Schema({ titulo: { type: String, } }) const Assunto = new Schema({ disciplina: { type:…
-
0
votes1
answer195
viewsConvert JSON to CSV
I’m developing a tool that captures information from the github API and saves it to a file .json. Code: const axios = require('axios') const fs = require('fs') const data = require('./data.json');…
-
0
votes1
answer24
viewsPerform an update on Mongo DB grouped fields
I have a Node application that connects to Mongodb, in it I have an endpoint using express that returns me the largest balances grouped by agency: router.get("/private", async (_, res) => { try {…
-
0
votes0
answers38
viewsQuery mysql INSERT returns nothing, even after
I recently started using Ode and I’m kind of having a little problem. I’m trying to insert a product into my "products" table but I didn’t put auto-increment in its ID, so to save the right ID I’m…
-
0
votes1
answer58
viewsWhat should I put into parenthesis?
Hello I’m starting to program now and I was following a video lesson and following the teacher’s steps, however arrived in a part that he installed the sqlite, however his version was previous to…
-
0
votes1
answer111
views* Referenceerror: Session is not defined *
I’m having a problem, sharing the Express cookie user data and session functions! the goal is to store such data in my Socket.IO, but it presents a reference error problem where it says the session…
-
0
votes1
answer80
viewsReact Nextjs - Path of the Undefined parameter after giving Refrech ( F5 ) on the page
Note: Eco Systems used here: Nextjs, Adonisjs and Mysql I have following code where I make a news presentation, what happens is the following... right after I come from the news listing, and select…
javascript node.js react adonisjs nextasked 4 years, 2 months ago Carlos Gustavo Souza Guimarães 42 -
0
votes0
answers56
viewsDoubt/problem redirecting after form submission with Node.js
Well, I’m new to programming and I’m trying to make a prototype of frequency recording to learn a little bit more about how to handle the database. My application has an area that I can be…
-
0
votes1
answer601
viewsHow to save a json object to mongodb, which is the answer to an API post
I need to save a certain field,from a json object,which comes from the response of an API I called. Save some fields of this response json object,in some fields of my colletion/model on Mongodb also…
-
0
votes2
answers368
viewsHow to take data from a specific field in an XML,with Nodejs,and then save it in the Mongo database
In an API response, it brings me an XML, but I need to capture just a few specific fields and save it in my database Mongodb with the package Mongoose,using Nodejs and Axios. My XML response comes…
-
0
votes1
answer39
viewsLoop adding repeated values
I have a loop inside a request, which adds an ID in an array, so that on the next repeat it checks if this same ID is no longer added. and if it is already in the array, skip to the next array id.…
-
0
votes1
answer84
viewsHow to add variables concatenated into a url link?
I have the following code: var config = { method: "post", url: "https://my-api-link/v2/[email protected]&token=EAD7FC0724EF4254FG34323D62FEF2", headers: {} }; I wanted to save the…
-
0
votes1
answer45
viewsDoubt/problem with "res.locals" after authentication
I am trying to get the data of the authenticated user, I read some things and I was trying, I was able to get all the user’s data but I can not only get information, as for example the name of the…
node.jsasked 4 years, 2 months ago André Cabral 87 -
0
votes0
answers20
viewsImage Transport Using Nodejs Request Module
I have a code that makes a request for a site is delivery to the user But it can not send Images The Image Does Not Load(When I lower the image it shows q ta corrupted) When I enter the Site.…
-
0
votes2
answers747
viewsHandlebars: Access has been denied to resolve the Property "title" because it is not an "Own Property" of its Parent
I’m having a problem with displaying mysql data by handlebars: Executing (default): SELECT `id`, `titulo`, `conteudo`, `createdAt`, `updatedAt` FROM `postagens` AS `postagens`; Handlebars: Access…
-
0
votes0
answers120
viewsProblem validating form data (nodejs, express, jquery and handlebars)
I have a problem in Nodejs when it comes to validating a form. I want, if there is an input incorrectly typed, to be shown an Alert pro user (without leaving the form route). For this, I put an if…
-
0
votes1
answer30
viewsError trying to generate Webpack
It has a project that uses webpack along with nodejs and angular, but when trying to use the "webpack" command on the terminal to generate the webpack Bundles it displays the following error…
-
0
votes0
answers137
viewsPOST method does not work properly Node.js and express
good evening, by way of tests I created a small API to understand its functioning, however when running the POST method I found that it only returns me the empty keys: [ {} ] The correct thing would…
-
0
votes1
answer211
viewsQuery in Sequelize separating Month and Year
Hi, guys. Sorry if my question seems a bit silly, but I’m starting now and doing this query is tying my head in a knot kkk Next, I’m building a system to manage the company’s vouchers (advances). I…