Mongoose deleteOne

Introduction Mongoose provides many methods to delete documents from a collection. One of these methods is deleteOne(). People often confuse deleteOne() with delete(). But there is no method known as delete() in mongoose. The method that is used to delete a single document from a MongoDB collection is the deleteOne() method. In this article, we … Continued

How to Use the Mongoose findByIdAndUpdate Method

Introduction Updating data from a database can become hectic when there is way too much data. Mongoose provides a lot of methods to update data from MongoDB. Each of these methods is useful in their own way. One of these methods is the findByIdAndUpdate() method. The findByIdAndUpdate() method is specifically used to find a document … Continued

How to Use the Mongoose findOneAndUpdate Method

Introduction Updating data is a critical task. While performing the update operations, we should keep in mind, that a little mistake can cause a big problem. Mongoose provides many effective methods for updating data. These methods are designed for a single purpose (i.e. updating) but they work differently. One of these methods is findOneAndUpdate(). In … Continued

How to Use the Mongoose Find Method

Introduction Out of all the CRUD operations, retrieving data is most commonly used. There are many methods retrieving data from MongoDB when using mongoose. One of the most popular methods is the find() function. The find() function retrieves all the existing documents in a collection. We can also specify queries and projections to get the … Continued

How to Use the Mongoose Connect Method

Introduction MongoDB is a NoSQL database that stores data in the JSON format. It is one of the most popular databases in the modern web development world. MongoDB is often used with software stacks such as MERN and MEAN. Along with MongoDB, NodeJS is also an important part of these software stacks. MongoDB only creates … Continued

How to Use the Mongoose Limit Function

Introduction Usually, in a database, there is a huge number of data. Like in MongoDB, there can be thousands of documents. When we perform data retrieval operations, such as find, we may end up fetching these hundreds of documents in a single operation. It can cause problems. Sometimes we may need all the documents, and … Continued

Simple Chat App using NodeJS and MongoDB Atlas Part 2

Introduction The power of NodeJS and MongoDB can be harnessed to build a variety of applications. This multi-part tutorial explains how to create a simple chat app using NodeJS and MongoDB Atlas. In our last article, we began our project by creating two files named server.js and index.html, and we were able to serve the … Continued

How to CRUD MongoDB using NodeJS and SailsJS Part 1

Introduction This tutorial is an installment of the multiple-series “How to CRUD MongoDB using NodeJS and SailsJS.” Here, in Part 1, you’ll learn the beginning steps to successfully construct a new SailsJS project. This includes completing the project directory setup and modules installation steps for the application. The basic computer programming actions are create, read, … Continued

How to CRUD MongoDB using NodeJS and SailsJS Part 3

Introduction This is Part 3 of multiple-series tutorial, “How to CRUD MongoDB using NodeJS and SailsJS.” In Part 2, you learned how to use Bootstrap to assist with Embedded JavaScript (EJS) files. This enabled you to create a homepage design sample. You also incorporated MongoDB. Today, In Part 3, you’ll learn how to successfully configure … Continued

How to CRUD MongoDB using NodeJS and SailsJS Part 5

Introduction Welcome to Part 5 of, “How to CRUD MongoDB using NodeJS and SailsJS,” the multiple-series. In Part 4, you discovered how to delete a MongoDB document based on its ID. Today’s lesson will explain how to update a document. It’s the “U” part of CRUD. Let’s start. Prerequisites Complete the instructions for Parts 1, … Continued

Keep in the know!

Subscribe to our emails and we’ll let you know what’s going on at ObjectRocket. We hate spam and make it easy to unsubscribe.