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
answer309
viewsAdonisjs, how to update multiple tables with just one await?
I’m learning to work with Adonisjs and I found several ways to update, but I always like the most performative way, after reading several articles and the documentation came to the following code:…
-
0
votes1
answer485
viewsHow to send a token to Header Authorization (Node/Ionic/Angular)
Good afternoon, I would like some guidance on how I could take the token being generated in my back-end (Nodejs + Express + Mongodb API) and save it in Header Authorization when the user logs in to…
-
0
votes1
answer350
viewsTake Json value with Node
I want to login to a site, using Node. The login would perform a select in the database, according to the E-mail entered, and then check if the password is in agreement. In login Submit, I perform…
node.jsasked 4 years, 11 months ago Gabriel Arruda 45 -
0
votes2
answers331
viewsAdonis make:model generating model with different name
I executed the Adonis command make:model Caredperson -mc so that the controller and Migration were created together. After executing the command, I tried to change the name of the model, Migration…
-
0
votes0
answers78
viewsNode js error importing module
Good afternoon to everyone, I am trying to organize my project, I prescribe to work with Ode, I have a function that creates a chart, I separated it into a separate file and exported this function…
-
0
votes1
answer111
viewsHow can I make my Ode application available in many languages?
Hello, I have a Ode application that uses express and handlebars, I would like to make it available in 3 different languages (Portuguese, Spanish and English). I managed to do this by creating a…
-
0
votes1
answer2839
viewsAjax request with Node.js and express
I’m completely new working with nodejs, I’ve seen some questions similar to mine but I couldn’t, and I didn’t understand straight would have as someone give me a help? In case I am trying to send an…
-
0
votes1
answer102
viewsIs there a performance gain in concatenating strings directly into SQL?
Actually, I have a code kind of like this: const users = await query(` SELECT "id", "username", "email" FROM "users"; `) .then((users) => users.map((user) => { user.id =…
-
0
votes1
answer174
viewsHow to properly configure db-migrate nodejs? Error in database.json
I’m trying to use db-migrate but I’m getting the answer, when running db-migrate up, the mistake: [ERROR] TypeError: Cannot read property '1' of null at Class.parseName…
-
0
votes1
answer1043
viewsHow can I create a Many to Many relationship in Adonisjs?
Well, I created a Many to Many relationship, just as I saw in the documentation, some posts and some videos on the internet, I was not successful in any attempt by some mistake of mine that I can’t…
-
0
votes1
answer206
viewsAdd Where’s in query if you receive filter parameter in Adonis/Node
Currently I have this query that returns all users: async index({request}) { const page = request.input('page') const pageSize = request.input('pageSize') const users = await User .query()…
-
0
votes1
answer377
viewsMiddleware that saves a user_id after a request to Adonis.js/Node.js
I own the following table job: job -------------- id INTEGER PK, name VARCHAR, user_id INTEGER FK I need to save in the column user_id the id of the user who created that record. I tried to create…
-
0
votes1
answer72
viewsDoubt when using a Query answer in Nodejs
Well, first, I have two files: index.js that handles the requests and another that selects in the database, but I don’t know how to return it to the client. app.get('/pesqAlimentos', (req, res)…
-
0
votes1
answer309
viewsAdd images to mongodb via api using Postman
Good morning, I’m building an api on nodejs to access mongodb. I want to add images in this database and return the path of this image to my android application. I want to store the images directly…
-
0
votes1
answer895
viewsCORS is not enabling
I developed a API REST in Node.js and I need to use it in my front-end. I’ve installed the library Cors and enabled on my server but continues to give the error of access when making the request…
-
0
votes1
answer370
viewsWhen to close a postgres pool at Nodejs?
I’m with a Nodejs application that basically has a food search engine. However always in the second research occurs the following exception and I do not know in what part of the code exactly I…
-
0
votes1
answer94
viewsAbout Hooks Classmethods Sequelize
I have a question in the operation of classmethod Hooks etc I have a model: const bcrypt = require('bcrypt'); module.exports = (sequelize, DataType) => { const User = sequelize.define('tb_users',…
-
0
votes1
answer36
viewsNode JS + FACEBOOK WEBHOOK
Hello, I have a problem confirming the token SHA1 generated by facebook, I believe rawBody is wrong and is not passing the payload as it should, could take a look and see if they find the problem?…
-
0
votes1
answer69
viewsUpdate nested array in mongodb
Hello, I have been looking for a solution to my problem, which I will mention below, but I still haven’t found the right way to solve it, the solutions I find usually update the whole array rather…
-
0
votes0
answers27
viewsHow to recover an idUsuario(user_id) from an idAnuncio(ad_id) models by Discount(Discount) Discounts? REST API
I need to do a query to recover a User’s discounts(idUsuario = user_id) by the Discount models' numbers, however, discount is only related to an idAnuncio(ad_id), so it’s like recovering an id via…
-
0
votes1
answer56
viewsClass logic in javascript
I will receive a JSON containing 2 objects: Player 1 and Player 2. It would contain the following structure: player 1: playerid socketid name points jogada player 2: player 1: playerid socketid name…
-
0
votes1
answer54
viewsUser.findOne() in a collection that is not 'Users'
I wrote an app that has an email verification logic and is triggered when the user makes the registration. I am using two models in Mongoose: one for users and one for authentication token. In token…
-
0
votes1
answer623
viewsselect sequelize performs different query of parameters passed with datetime
This is the function that performs the query: router.get('/out_filtered', async (req, res, next) => { try { const dateStart = req.body.date_start; const dateEnd = req.body.date_end;…
-
0
votes1
answer121
viewsMultiselect with search filter
I have a problem where I have a table that has 12,000 type records and I need to do a multi-select where the options appear according to the multiselect search filter. The intention is to facilitate…
-
0
votes1
answer29
viewsProblem with MYSQL data formatting
I am making a hotel management system using Javascript, Nodejs, Express and MYSQL. I need my date format to be DAY/MONTH/YEAR, this way: DATE_FORMAT(dt_entrada, '%d/%m/%Y') DATE_FORMAT(dt_saida,…
-
0
votes0
answers45
viewsFfmpeg conflict running in different processes
I have a nodejs server that does some manipulations with audio files, using the Fluent-ffmpeg library, but when concatenating some files using the function: ffmpeg('./public/uploads/'+tmpFilename)…
-
0
votes0
answers63
viewsKnex - Nodejs Doubt (Graphql)
I want to return all my data from this table in my database. I am making the following query: async licitacaoAll(_, { dados }) { if (!dados) return null const { ativo } = dados return await…
-
0
votes1
answer74
viewsDuplicate Data Loop Query Nodejs
I’m having a problem with a loop loop on node js, this is the query exports.getValueMsg = function() { return new Promise((resolve, reject) => { pconn .pool .query("SELECT b.numero_serie,…
-
0
votes1
answer737
viewsSocket Disconnect Nodejs
Hello I have a socket in which when I run the command socket.disconnect() it return me Disconnect is not a Function, what could it be ? I have tried several ways to disconnect and none solved my…
-
0
votes1
answer65
viewsI am unable to run a Node.js application because of jquery
I tried to install a bootstrap in a Node.js application, then installed jquery and Popper.js, but now when I run my application this giving the following error. var version = $.fn.jquery.split('…
-
0
votes1
answer15
viewsError using Sound Exchange (Sox)
I am trying to use the Goggle Speech-to-text API in Node.js, but when I try to run the service I find the error: My environment of development at work today is Windows 7, however I already managed…
-
0
votes1
answer43
viewsReturn model function in controller
I need to return a model function in my controller as if it were a "virtual" from Mongoose, actually in the controller I would specify via "populate" the function name and return the function in the…
-
0
votes1
answer552
viewsCalling a javascript function in ejs files
I am trying to create in my js file a function to format a date by changing "-" to "/" and I am using Node.js and express as follows. function formatDate(str){ var format =…
-
0
votes1
answer38
viewsSending data via ajax generating new "_id" in Mongodb
I am sending information via ajax to the backend in Node to update a document in Mongodb, but whenever I send the form via frontend, it generates a new "_id" instead of searching for an existing one…
-
0
votes0
answers251
viewsNodejs, Express + Swagger
Hello, folks I was tasked with a mission to implement Swagger in an express application, with the purpose of generating Swagger.json for the AWS apigateway deploy. I have tried using swaggerJSDoc,…
-
0
votes2
answers85
viewsHow to select records that do not have relationships in a table in Node/Adonis?
I have three tables: students ------------ id INT name VARCHAR class ----------- id INT description VARCHAR student_classes -------- id INT student_id (FOREIGN KEY of students.id) class_id (FOREIGN…
-
0
votes1
answer255
viewsSearch database data with Nodejs
I have several charts from Google Charts because I am doing a Dashboard, the problem is that I need to make the connection with the bank via Nodejs for performance issues and acquire knowledge in…
-
0
votes3
answers2267
viewsHow to draw objects from an array?
I have in the variable optionsPergunta an object array and need to draw the position of the objects in this array: "options": [ { "id": 6, "book_unit_question_id": 2, "description": "get",…
-
0
votes1
answer366
viewsbcrypt.compare returning false even with correct password after certain period of time
I’m using the bcrypt to generate password hash in Node.js, as code below, after creating a user: UserSchema.pre("save", async function(next) { const hash = await bcrypt.hash(this.pass, 8); this.pass…
-
0
votes0
answers37
viewsSession vs Cookie, what’s the difference?
I have a question on Sessions and Cookies on the Node, regarding where they are stored and how it works. At first I know the following statements: Cookies I can set when time it can save your data;…
-
0
votes2
answers2181
views-bash: nodemon: command not found
Hello, I wonder if you have someone with the same problem or something similar I ran this code sudo npm install nodemon and returned this to me /Users/apple/.npm-global/bin/nodemon ->…
-
0
votes1
answer232
viewsLoyalty points system unexpectedly distributed points | Node.js Tmi.js
I am currently developing a chat bot for my Twitch channel. I want to implement a system of loyalty points that are distributed after a while only to those who are present in the chat, so I have to…
node.jsasked 4 years, 9 months ago João Ferreira 76 -
0
votes2
answers844
viewsCount how many equal names there are within a JSON and display in Nodejs screen
I have a json that has names of equal people, and I need to count how many names are repeated and give a total sum. I did it one way, but he’s counting the number of characters in the name and not…
-
0
votes1
answer196
viewsHow to serve a frontend in Vue.js/Vue-cli on the local network and use it for workstations that have no internet connection?
I need to develop a web application with the following scenario: Server: hosts the application, has internet connection to communicate with Apis; Stations: restricted machines, no internet…
-
0
votes2
answers306
viewsError exporting footer in Reactjs
When running the npm start command returns the error below in the terminal, I am importing the file /components/footer/Footer.js in the archive /src/index.js //ERROR Failed to Compile.…
-
0
votes1
answer281
viewsValidation of regex with Indicative (adonisJs)
I am trying to validate a CPF with regex using the Adonis Database. I tried that way: const { validations } = use('indicative/validator') const { validate } = use('Validator') const rules = (values)…
-
0
votes1
answer59
views"App Crashed" in Heroku log
I am having a problem with my Node application that is on the Heroku server. When I make many requests for the same route /oapi/login the application stops running, the error that the log returns is…
-
0
votes1
answer64
viewsTrouble getting Oauth2 token
I’m having trouble getting the token from Oauth2 I’m trying by Postman to get the token. I have registered in the user who is trying to get a token { "statusCode": 400, "status": 400, "code": 400,…
-
0
votes1
answer9533
viewsProblem with promisse, returns: "Promise {<pending>} "
Talk personal! I have a problem connecting Node.js with Spreedsheet. I use the function below to fetch the 'date' value in my spreadsheet. Until then it works very well, however, when I use "date"…
-
0
votes1
answer95
viewsPopular object with async/await nested
Personal talk, I am consuming the Trello API to retrieve items from card-specific checklists of a frame. So I am making the following path. Retrieving information from the table Retrieve information…