Creating A Custom Event In JavaScript: Simplest ExplanationIn this post, I will explain what are custom events in the simplest possible way. In summary: it's not as complicated or cool as it sounds; it is only a one-line thing. To create a custom event, we simply use the syntax: const event = new Event(TheEv...Jan 23, 2023 · 1 min readjavasper.hashnode.dev
How To Get The Total Number Of Returned Rows From A Query In MongoDB: Simplest ExplanationIn this post, I will show you the quickest way to get the total number of results that your query returned. When I was looking online, I could only find long-winded answers to this question, so here is my attempt at a simple and straight solution. ...Oct 6, 2022 · 1 min readjavasper.hashnode.dev
How To Find Data In A Collection Using MongoDB?In this post, we will learn how to get data from a collection using Express.js and MongoDB. Usually, this is the first thing you learn how to do when you are learning MongoDB. The syntax is as follows: Model.find({/*your search criteria*/}) Model i...Oct 5, 2022 · 2 min readjavasper.hashnode.dev
How To Add A Row To The CollectionThe easiest way that we can add a new row to a collection in our MongoDB is to use Model.create({}). If we want to add a row (you can think of row as meaning "new data") to our collection Name we could write: Name.create({write the column names and v...Oct 5, 2022 · 2 min readjavasper.hashnode.dev
How To Send Data From A Form Using Express?In this post, I will show you how to send data from a form using express.js. Sending data with express is very easy. In short, to get the data that has been sent over to another page(e.g. a controller), we use req.body.theInputName, where theInputNa...Oct 5, 2022 · 2 min readjavasper.hashnode.dev