Skip to main content

Posts

Showing posts with the label MongoDB

Mongo Shell Commands Quick Start

Introduction: MongoDB is a document-oriented database, which is classified as a NoSQL database. In MongoDB, tables are called collections and records are called documents. It stores data in JSON format. The reading of data from MongoDB is fast when compared to the Relational Database. Installation: Install MongoDB Community Edition . Here we run MongoDB as a windows server for local development and for learning MongoDB. After successful installation, go to the location "C:\Program Files\MongoDB\Server\4.2\bin" then run "mongod.exe" which starts MongoDB server as windows server. Uses port "27017" as default to serve the requests. Run "mongo.exe" shell command, used as an interface to query the MongoDB. Query Commands: Database: Create a new database by running the command "use your_database_name" on the  "mongo.exe" shell command. To see all the existing databases run the command "show dbs"

Dotnet Core Basic CRUD Operations With MongoDB Using Repository Pattern

Introduction: MongoDB is a document-oriented database, which is classified as a NoSQL database. In MongoDB, tables are called collections and records are called documents. It stores data in JSON format. The reading of data from MongoDB is fast when compared to the Relational Database. But MongoDB doesn't have a relation between the collections. We can't declare NoSQL is better than SQL or vice-versa. So depending on the application requirement either select NoSQL or SQL or Both database. Dotnet Core by default uses an MSSQL database, but it has built-in support for all other types of datastores like MYSQL, ORACLE, and MongoDB, etc. Step 1: Click here  to install the MongoDB community edition. After successful installation go to  "C:\Program Files\MongoDB\Server\4.2\bin" and then run "mongod.exe". Now we started MongoDB server in our local machine on a default port 27017. Step 2: Now open MongoDB shell command "mongo.exe" which is found