Difference between revisions of "MongoDB Documents"
Line 9: | Line 9: | ||
For example, a record for a lecturer could be: | For example, a record for a lecturer could be: | ||
+ | <pre style="color: blue"> | ||
{ | { | ||
name: "myName", | name: "myName", | ||
Line 16: | Line 17: | ||
jobTitle: "Senior Lecturer" | jobTitle: "Senior Lecturer" | ||
} | } | ||
+ | </pre> | ||
This follows a field:value pair format. | This follows a field:value pair format. | ||
Where: name, roomNo, telNo, qualifications and jobTitle are fields and myName, MI412, 2222, ["BSc Computer Science", "MSc Advanced Computing", "PhD NoSQL Databases"] and Senior Lecturer are values | Where: name, roomNo, telNo, qualifications and jobTitle are fields and myName, MI412, 2222, ["BSc Computer Science", "MSc Advanced Computing", "PhD NoSQL Databases"] and Senior Lecturer are values |
Revision as of 16:58, 18 October 2016
Main Page >> MongoDB >>MongoDB Workbook >> MongoDB Documents
Document Database
MongoDB is an example of a NoSQL Document database. This means in MongoDB, databases hold collections of documents. Each student has their own individual database, where documents can be created.
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 field:value pair format.
Where: name, roomNo, telNo, qualifications and jobTitle are fields and myName, MI412, 2222, ["BSc Computer Science", "MSc Advanced Computing", "PhD NoSQL Databases"] and Senior Lecturer are values