Non-Relational Database 2 | Basic MongoDB Concepts and CRUD Operations

mongodb

1. Basics of MongoDB

(1) The Definition of Documents

A record in a MongoDB collection and the basic unit of data in MongoDB. Documents are analogous to JSON objects but exist in the database in a more type-rich format known as BSON.

(2) The Definition of Collections

A grouping of MongoDB documents. A collection is the equivalent of an RDBMS table.

(3) The Definition of Fields

A name-value pair in a document. A document has zero or more fields. Fields are analogous to columns in relational databases. For example, a certain MongoDB document will be seen as follows,

(4) Reasons for MongoDB

(5) Data Type of MongoDB

2. Mongo DB Operations

(0) External Operations

Note that this command requires mongo-tools,

We can also select the mode by option --mode between insert (means to allow duplicate) or upsert (means to update duplicate).

(1) Creation

(2) Read

(3) Update

(4) Delete