So basically my addrole command after the new version of discord.jsv13 no longer works and displays errors like role.id is not a function or role.id is not defined even though I believe there is no error, I’m pretty experienced with javascript but I tried different methods of fixing it but neither seem …
Tag: node.js
fetch specifi data from json and store them in array using node js / Javascript
I am trying to fetch all the log details from this json object but the problem is this key always get changed this is my json Object and I want fetch all the log which are present inside the json object and store them in one array like this here user_1 user_2 get changed everytime and I wanted to tackle
JS fetch should do action on server write
Given is the following node stack: Client (VUE) (8080) Server (express.js) (3000) The client sends a get to a server route, inside the server route a task is running that takes some time but could easily been mapped because server is working over an array of data. Is it possible that the server can send a res…
Alamofire upload JSON response not compiling
I’m doing an Alamofire upload to the server and want to decode some JSON that’s sent back in response. On the line where I’m guarding that data.result.value has a value (the JSON response sent from the server), I’m getting a ‘Type of expression is ambiguous without more context&#…
Return promise from Fetch when posting through Nodemailer
I want to run code in a .then() after a fetch() resolves, the issue is that my .then() does not run after the POST method resolves, it does however if it rejects. What I am doing is sending a mail through my server using Nodemailer. So I’m not entirely sure what the issue is but perhaps Nodemailer doesn…
How to do an action after callback in node?
How to fire the final console.log AFTER the callback is finished. Answer The easiest way is to just log the final line from within the callback:
i am just trying to install the package of react js but i am getting errors
I am just trying to install react but I am getting errors. I have installed npm -v 8.12.1 version in my system. I have tried to downgrade react but it doesn’t help I have tried these type: update npm npm install npm -g downgraded react to “react”: “15.3.0” cleared cache: npm cach…
MongoDb query return empty object
I’m trying to perform a simple .find() query on my mongodbAtlas, but the result of this query is an empty object. this is my server file: this is my routes file: this is how my document is populated: Answer I think you are missing the “await” keyword after const data….. as API data fet…
Mongoose how to count unique days in a month?
i am working on a problem where in my database there supposed to be multiple entries from day to day. each entry includes a timestamp. the problem is im supposed to find how many days in each month a data has been entered. ex: if a user sends a message every 2 days in may. my answer would be: “the
How to Display Value Created from API Onto My Browser?
So I am working with this API and it auto calculates the delivery fee based on the address you input. Here’s the API docs I am using https://developer.doordash.com/en-US/api/drive#operation/DeliveryQuote So when I add my values to my form and get my data, it logs the fee in my console like this My issue…