MongoDB – Data Modelling Data in MongoDB has a flexible schema.documents in the same collection. They do not need to have the same set of fields or structure Common fields in a collection’s documents may hold different types of data. Data Model Design MongoDB provides two types of data models: — Embedded data model and […]
Author Archives: user
MongoDB – Drop Collection In this chapter, we will see how to drop a collection using MongoDB. The drop() Method MongoDB”s db.collection.drop() is used to drop a collection from the database. Syntax Basic syntax of drop() command is as follows − db.COLLECTION_NAME.drop() Example First, check the available collections into your database mydb. >use mydb switched […]
MongoDB – Create Database In this chapter, we will see how to create a database in MongoDB. The use Command MongoDB use DATABASE_NAME is used to create database. The command will create a new database if it doesn”t exist, otherwise it will return the existing database. Syntax Basic syntax of use DATABASE statement is as […]