Difference between revisions of "MongoDB Overview"

From mi-linux
Jump to navigationJump to search
Line 38: Line 38:
 
== SQL? ==
 
== SQL? ==
  
MongoDB does not support SQL. It can be used by a variety of languages, the version installed on mi-linux uses Javascript to access the database.
+
MongoDB does not support SQL.  
 +
 
 +
It can be used by a variety of languages. The mongo shell installed on mi-linux uses Javascript to access the database.
  
 
== Next Step ==
 
== Next Step ==
  
 
Return to the [[MongoDB_Workbook|Workbook]].
 
Return to the [[MongoDB_Workbook|Workbook]].

Revision as of 15:47, 20 October 2016

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. A collection can hold one or more document. 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 document in MongoDB as being a record or row in a relational table. The document has a data structure composed of field and value pairs, which correspond to a column in a relational table. 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.


SQL?

MongoDB does not support SQL.

It can be used by a variety of languages. The mongo shell installed on mi-linux uses Javascript to access the database.

Next Step

Return to the Workbook.