Mapping Relational Databases to MongoDB - LearnHowToCode SarkariResult.com Interview Questions and Answers LearnHowToCodeOnline
Mapping Relational Databases to MongoDB

Mapping Relational Databases to MongoDB

Mapping Relational Databases to MongoDB

If you are coming from a relational database background then it might be difficult for you to relate the RDBMS terms with MongoDB. In this guide, we will see the mapping between relational database and MongoDB.

Mapping relational database to MongoDB

RDBMS MongoDB Mapping
Collections in MongoDB is equivalent to the tables in RDBMS.
Documents in MongoDB is equivalent to the rows in RDBMS.
Fields in MongoDB is equivalent to the columns in RDBMS.
Fields (key and value pairs) are stored in document, documents are stored in collection and collections are stored in database.
This is how a document looks in MongoDB: As you can see this is similar to the row in RDBMS. The only difference is that they are in JSON format.
Document in MongoDBTable vs Collection
Here we will see how a table in relational database looks in MongoDB. As you see columns are represented as key-value pairs(JSON Format), rows are represented as documents. MongoDB automatically inserts a unique _id(12-byte field) field in every document, this serves as primary key for each document.
Format mapping relational database_to_MongoDB
Another cool thing about MongoDB is that it supports dynamic schema which means one document of a collection can have 4 fields while the other document has only 3 fields. This is not possible in relational database.

About Mariano

I'm Ethan Mariano a software engineer by profession and reader/writter by passion.I have good understanding and knowledge of AngularJS, Database, javascript, web development, digital marketing and exploring other technologies related to Software development.

0 comments:

Featured post

Political Full Forms List

Acronym Full Form MLA Member of Legislative Assembly RSS Really Simple Syndication, Rashtriya Swayamsevak Sangh UNESCO United Nations E...

Powered by Blogger.