Microservices architecture in NodeJS is a group of loosely-coupled services that works independently of each other. Failure in one service does not affect the other services in the system. Consider each service as a separate server or system. For example, you have a social networking website. So you can create one microservice that handles all …
Read More “Microservices in NodeJS”
In this tutorial, we will teach you, how you can add emoji between text using jQuery. Emoji picker is a library that allows you to select a wide variety of emojis. It is a Javascript library that returns the emoji character. You can append the emoji in your input fields as well. This library is …
Read More “Add emoji between text – jQuery”
Middleware in Node JS is called before the request is handled by the router function. They stand between the router and the request. Middlewares are great when it comes to processing and validating request values before they reach the route. Make sure you have downloaded and installed Node JS in your system first. You can …
Read More “Custom middleware in Node JS”
In this article, we are going to show you a technique that helps you call a function when the user stops writing in an input field, using Javascript. Suppose you have an input field for search and you want to show search suggestions to the user as he types. So typically you do the following: …
Read More “Call function when user stops writing input field – Javascript”
In this tutorial, we will teach you, how you can do pagination on arrays of documents in MongoDB. If you have a very large database, fetching all the documents in one query might be very slow. But we have a solution: Pagination. It allows you to fetch a few records in one query and the …
Read More “Pagination on arrays – MongoDB”
Google Chrome by default autocomplete the input field. The HTML autocomplete attribute no longer works on chrome. We present to you 2 methods you can use to disable the autocomplete feature for input fields in chrome and other browsers. 1. Set input DOM value When the page loads, wait for half second, then set the …
Read More “2 ways to disable chrome autocomplete on input fields”
In one of our tutorial, we learned how to create a function in async await and how to create a function that uses callback. Video tutorial: Asynchronous Let’s say you want to send an email to a user. Following is a Node JS code that sends an email using a callback: In your terminal, you …
Read More “Practical difference between async await and callback”
MEVN stands for Mongo DB, Express JS, Vue JS, and Node JS. It is a technology stack used by developers to create full-fledged web applications. Most of the applications created in the MEVN stack are single-page applications. But it is up to you if you want to single page or multi-page web application. Table of …
Read More “A guide to MEVN”
We need to use the aggregate function to pick a random document from Mongo DB. Its usage is simple. It accepts an array of objects. You need to pass $sample object in one array object and tell the number of random documents you want to fetch in the size object. Suppose you have the following …
Read More “How to pick random document from Mongo DB”
Create the following function in Javascript to add or update URL query parameter. Now, whenever you want to add or update the URL, simply call the function in the following way: The first parameter will be the key of the parameter, and the second will be the value. window.location.search: will return all the query parameters …
Read More “Add or update URL query parameter in Javascript”