Closed. This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed 8 months ago. Improve this question How do I properly send a discord API request, and where do I get a valid …
Tag: node.js
Don’t store keys with empty string values in mongodb document
i would like to store a post as a document in mongodb. I’m using mongoose for modelling and the content is created by a user using a form. The content of the form is append to FormData and sending to server. This works so far. The only issue is, that empty fields, that are appended as empty strings in the
gRPC: Unknown JSON as input and output
I’m new to gRPC, I’m trying to expose gRPC server in which and rpc does not have known shape before hand. Requirement is that particular field can have any value present in it. Ex: file.proto When i went through the docs there is no way we can create gRPC server without knowing the fields before h…
A relative path is not allowed to use COPY to a file
I made a function so that when I click on a button it made a “COPY TO” querie to the server. The goal is to export a table database in .csv that goes to the user downloads of my application. I first tried to write the database table in an existing file with the following querie : } But the
Unable to load CSS file within nodeJS app
I have an app that I followed from a tutorial for the backend in nodeJS and Express. My connection to MongoDB via Mongoose is working. However, I’ve been trying to add a front-end- at the moment- just a simple html/ejs/css form. My endpoints are loading in localhost but only the html/ejs is rendering. M…
How to get a certain element from a body?
I use node-fetch , and I get the body of the site this way: The console displays the full body of the entire page. But I want to get a specific element with a certain class. How do I change the code to do this? Answer You can use cheerio.js. It is an implementation of jQuery for node. The below
String tokenizer method
Consider strings with this format: where id, string1, string2 and string3 can be string of variable length, and extension is an image extension type. For example, two possible strings could be: I need tokenizer method in JavaScript for an express/nodejs API that takes these strings in input and outputs an obj…
How to Make a ShopifyQL query?
Shopify recently announced ShopifyQL for easier accessing of analytics data. However, I’m unclear of how to actually make a ShopifyQL call. They do include an example. However, using the GraphiQL tool to run the query hits a number of errors: I also tried making an authenticated call with the example qu…
Is pushing an object to an array async operation?
I was doing one problem-solving program where I had to find all the pairs from an array that adds up to a target (classic two-sum program just with a little addition). This was my first approach: ** This should output: [{first: 8, second: 2},{first: 7, second: 3}] but instead it prints: [{first: 7, second: 3}…
What is this structure in javascript return({object}={})=>{more code}?
I’m trying to understand what this code is doing, it’s from a nodejs. I don’t understand what is this structure is doing return({object}={})=>{more code} you can find the repository here: https://github.com/howardmann/clean-node/blob/master/models/teacher/teacher.js Answer In addition to …