Mongoose - Terminologies
January 25th 2021 65
‘Collections’ in Mongo are equivalent to tables in relational databases. They can hold multiple JSON documents.
‘Documents’ are equivalent to records or rows of data in SQL. While a SQL row can reference data in other tables, Mongo documents usually combine that in a document.
‘Fields’ or attributes are similar to columns in a SQL table.
While Mongo is schema-less, SQL defines a schema via the table definition. A Mongoose
‘schema’ is a document data structure (or shape of the document) that is enforced via the application layer.
‘Models’ are higher-order constructors that take a schema and create an instance of a document equivalent to records in a relational database.