- vừa được xem lúc

[DATABASE - MONGO] Introduction to MongoDB

0 0 12

Người đăng: Vivian

Theo Viblo Asia

I. Introduction

  • MongoDB is an open source NoSQL database management, designed to store a large scale of data and allows to work with data efficiently. (high performance, high availability and easy scalability)
  • MongoDB is written in C++.
  • It uses collections and documents to store data instead of using tables like traditional relational databases.
  • Data is stored in json format called bson.
  • MongoDB allows users to save nested documents.

1. Database

  • Database is a physical container for collections.
  • A MongoDB server can have multiple databases.

2. Collection

  • A collection is a set of MongoDB documents, it is the equivalent of an RDBMS table.
  • Collections do not enforce a schema which means documents in the same collection can have different fields.
  • Documents in the same collection have the related purpose.

3. Documents

  • Document is a set of key-value pairs.
  • It has flexible schema (they dont need to have the same sets of fields or structure).
  • Documents' common field can hold different data types.

4. Example of document

{ _id: ObjectId(7df78ad8902c) name: 'Vivian', gender: 'female', abilities: ['reading', 'speaking', 'eating'], friends: [ { name:'Ann', gender: 'female', }, { user:'Irene', gender: 'female', } ]
}

5. Comparision of RDBMS and MongoDB structure

RDBMS MongoBD
Database Database
Table Collection
Row Field
Table Join Embedded documents
Primary key default key _id auto-created by MongoDB

II. Installation & setup

  • Open the msi file when the download is completed and click next button.

  • Accept the End-USer License and click next.

  • Click complete.

  • Copy link of Data Directory and click next.

  • Click next then install MongoDB and wait for the process to complete.

  • Click finish to complete installation process.

  • Go to path C:\Program Files\MongoDB\Server\your-version\bin where MongoDB installed and copy this path.

  • Create an environment variable.

    • open system properties > select environment variables

    • choose Path and click Edit

    • Click New > Paste the copied path > OK.

  • Open C drive and create folder data and its sub folder db then open command prompt and run mongod command. If data is shown, that means the MongoDB run successfully.

Bình luận

Bài viết tương tự

- vừa được xem lúc

TÌM HIỂU VỀ MONGODB

. 1. Định nghĩa về MongoDB. . MongoDB là một cơ sở dữ liệu mã nguồn mở và là cơ sở dữ liệu NoSQL(*) hàng đầu, được hàng triệu người sử dụng.

0 0 31

- vừa được xem lúc

Mongo DB cho người mới bắt đầu !

Lời nói đầu. Gần đây, mình mới bắt đầu nghiên cứu và sử dụng mongo db nên có chút kiến thức cơ bản về Mongo muốn share và note ra đây coi như để nhở (Biết đâu sẽ có ích cho ai đó).

0 0 23

- vừa được xem lúc

Áp dụng kiến trúc 3 Layer Architecture vào project NodeJS

The problem encountered. Các framework nodejs phổ biết như Express cho phép chúng ta dễ dàng tạo ra Resful API xử lí các request từ phía client một cách nhanh chóng và linh hoạt.

0 0 64

- vừa được xem lúc

Mongo DB cho người mới bắt đầu ! (P2)

Lời nói đầu. Gần đây, mình mới bắt đầu nghiên cứu và sử dụng mongo db nên có chút kiến thức cơ bản về Mongo muốn share và note ra đây coi như để nhở (Biết đâu sẽ có ích cho ai đó).

0 0 169

- vừa được xem lúc

Xây dựng CRUD RESTful API sử dụng Node, Express, MongoDB.

Introduction. Trong phạm vi bài viết này chúng ta sẽ cùng tìm hiểu về cách tạo restful api với Node, Express và MongoDB. . Xử lý các hoạt động crud.

0 0 213

- vừa được xem lúc

MongoDB là gì? Cơ sở dữ liệu phi quan hệ

Bài viết này mình sẽ giúp các bạn có cái nhìn tổng quan về MongoDB. Chúng ta không lạ gì với cơ sở dữ liệu quan hệ, còn với cơ sở dữ liệu phi quan hệ thì sao? MEAN stack (MongoDB, Express, AngularJS,

0 0 38