Spring 5.0 Projects
上QQ阅读APP看书,第一时间看更新

MongoDB data structure

Before using MongoDB, it is important to understand the schema and data structure used in it. Like a relational database, we need to first create a database in MongoDB. Along with the database, we also need to create a collection. You can consider a collection to be similar to the database table in RDBMS. 

Connect the Compass (default: no credentials) and click on the CREATE DATABASE button, and you will see model windows as follows:

You need to give the Database Name and Collection Name and click on the CREATE DATABASE button from the model window. You can now insert the data for student collection into MongoDB.