|
MongoDB database objects
We will begin our journey of understanding MongoDB database objects by comparing each object to its equivalent RDBMS object when applicable. There are some similarities between MongoDB and RDMBS objects, although the object names are different. MongoDB object names include databases, collections, documents, fields, and indexes.
The highest level container in a MongoDB server instance is a database. A database consists of one or more collections. A collection holds a grouping of documents just as a RDBMS table holds a grouping of records.
A document is made up of one or more fields, which as you probably guessed, are similar to table fields (that is, columns). Relational databases define fields at the table level while document-oriented databases define fields at the document level. Additionally, as with a RDBMS, MongoDB allows you to create indexes on fields for better sorting and lookup performance. |
|