MongoDB Overview

From mi-linux
Revision as of 16:39, 20 October 2016 by Cm1958 (talk | contribs)
Jump to navigationJump to search

Main Page >> MongoDB >>MongoDB Workbook >> MongoDB Overview

MongoDB is an example of a NoSQL Document Database. It works on concept of collections and documents.

Database

In MongoDB, databases hold collections of documents. Our MongoDB server supports lots of databases, since each student has their own individual database, where documents can be created.

Note: you do not need to create a database, it will be setup for you as part of the registration process.

Collection

MongoDB stores its documents in a collection. Collections can be compared to tables in a relational database.

The main difference to a relational database is that MongoDB does not support joins or transactions.

Document

You can think of a record in MongoDB as being a document, which is a data structure composed of field and value pairs. MongoDB documents are similar to JSON objects. The documents can be complex, where the values of fields can include other documents, arrays and arrays of documents.

For example, a record for a lecturer could be:

 {
    name: "myName",
    roomNo: "MI412",
    telNo:  "2222"
    qualifications: ["BSc Computer Science", "MSc Advanced Computing", "PhD NoSQL Databases"]
    jobTitle: "Senior Lecturer"
 }

This follows a key:value pair format.

Where: name, roomNo, telNo, qualifications and jobTitle are keyss and myName, MI412, 2222, ["BSc Computer Science", "MSc Advanced Computing", "PhD NoSQL Databases"] and Senior Lecturer are values.

Next Step

Return to the Workbook.