MongoDB Overview

From mi-linux
Revision as of 18:13, 18 October 2016 by Cm1958 (talk | contribs) (Created page with " == Database == MongoDB is an example of a NoSQL Document Database. This means in MongoDB, databases hold collections of documents. Our MongoDB server supports lots of databa...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search

Database

MongoDB is an example of a NoSQL Document Database. This means 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.

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.