CRUD operations in MongoDB

The acronym ‘CRUD’ stands for Create, Read, Update and Delete. In this section, we will learn basic CRUD operations. CRUD operations can be extremely complex sometimes but we will not go into the complex stuff for two reasons. First, it is not under the scope of this chapter. Second, we will be doing a lot of CRUD operations in the following chapters.

Before we start learning CRUD, I must tell you that we will be using mongo shell for CRUD in the following sections.

Create or insert document
Data can be added to MongoDB in the form of documents. To add document, we use the insert function. We pass the document to be inserted to insert() function. Let’s see an example – Continue reading CRUD operations in MongoDB