Tiếng Việt

Overview of MongoDB



Lê Thị Ý Nhi




1. What is MongoDb?

MongoDb is NoSQL database system, it means non-relational database. Unlike SQL or AdminPHP, MongoDb is similar to a JSON document which is a data structure consisting of field and value pairs. Field values can be documents or arrays, and pairs of fields and values between collections are also non-binding. The advantage of MongoDB is its flexibility in storing different data sizes. Because it is stored as JSON, you are free to insert information as you need. The process of checking compatibility when adding, deleting or updating data is fast, saving time.



2. Components in mongoDb.

Here are some components included in MongoDb:

Database: is a database of collections of these concepts just like SQL or AdminPHP side databases.

Collection: collection is equivalent to a table in MySQL that has not collected documents and collections do not have any structure rules.

Ex: Nest is called a database containing 2 collections cats and users


Document: A Document is a record in a collection, consisting of field and value pairs.

For example: A document of the collection cats, cat has name and age fields with values Xu and 3.


Field: is a field and data pair, it is similar to a column in MySQL. A document may contain one, many, or no fields at all.

As the example above, a field is name: "Xuu"

_id: _id is a special and mandatory in MongoDb, it is similar to when you declare a column of code of a table, it is the unique value of a document and helps distinguish between other documents. It is mandatory so if you forget to create it, don't worry MongoDb will automatically create it for you.

Cursor: In MongoDB, when the find() method is used to find the documents contained in the collection, this method returns a pointer that will point to the documents of the collection, now this pointer is called cursor.

JSON: is an extremely popular standard for data exchange on the web, is a human-readable data exchange format. JSON objects are a container where a field will be mapped to a value.

3. Data types in mongodb.

String: This is the most commonly used data type to hold data. Strings in MongoDB must be valid UTF-8.

Integer: This data type is used to store a numeric value. Integer can be 32 bit or 64 bit depending on your server.

Boolean: This data type is used to store a Boolean value (true/false).

Double: This data type is used to store floating point numeric values.

Min/ Max keys: This data type is used to compare a value with the lowest and highest BSON elements.

Array: This data type is used to store arrays or lists or multiple values into a key.

Timestamp: Convenient for recording or marking when a Document was modified or added.

Regular expression: This data type is used to store Regular Expresion.

Object: This data type is used for embedded documents.

Null: This data type is used to store a Null value.

Binary data: This data type is used to store binary data.

Symbol: This data type is used like a string, however, it is generally reserved for languages that use a specific symbol type.

Date : This data type is used to store the current date and time in the UNIX time format. You can define your own date time by creating a Date object and passing the day, month, and year into it.

Object ID: This data type is used to store the ID of the Document.

Code: This data type is used to store JavaScrip code into the Document.

4. MongoDb  admin support tool

Although there are many tools to support MongoDb administration such as Cluster control, MongoDB Compass, Nosqlclient, Mongo Management Studio or Studio 3T. But here I will introduce you to MongoDB Compass.

MongoDB Compass provides powerful graphical functionality to users without the need for a query language. The software also supports structure visualization and analysis of documents within an intuitive GUI in just a few seconds.

Features of MongoDB Compass:

Users can easily explore the entire visual data.

Lets see query performance.

Provides quick insight into query performance and server health.

No need to write command line.

Increase outreach efficiency and better interact with CRUD.

Help users review and make decisions about indexing, document validation, etc.

Install MongoDB Compass:

Step 1: To download MongoDB Compass, go to https://www.mongodb.com/download-center/compass?jmp=docs.

Step 2: You need to choose the installer and version you like. The GUI installer is available as a .exe or .msi package or a .zip archive.

Step 3: Finally, Click on the download button.

Step 4: Click on the installation file after the download is complete.

Step 5: Follow the pop-ups to install the MongoDB Compass GUI.

Step 6: Once installed, it will launch and ask you to configure privacy settings and specify an update option.

5. Conclusion

Above are a few of my introductions to MongoDB, you can learn more about MongoDB on the MongoDB homepage. Hope the MongoDB management system can help you a part in your work.


Related Articles



Basic instructions of manual testing

Contact Us