MongoEngine - MongoDB Setup



NoSQL databases have seen rise in popularity in the last decade. In todays world of real time web applications, huge amount of data is being generated with mobile and embedded devices. Traditional relational databases (like Oracle, MySQL, etc.) are not suitable for strings. The processing of such data is also difficult as they have fixed and predefined schema, and are not scalable. NOSQL databases have flexible schema and are stored in distributed manner on a large number of community servers.

NOSQL databases are classified on the basis of organization of data. MongoDB is a popular Document Store NOSQL database. Fundamental constituent of a MongoDB database is called a document. A document is a collection of key-value pairs stored in JSON format. More than one documents are stored in a collection. A collection can be considered as analogous to a table in any relational database, and a Document as row in a table. However, it should be noted that since MongoDB is schema less, number of key-value pairs in each document of a Collection need not be the same.

MongoDB is developed by MongoDB Inc. It is a general-purpose, distributed document based database. It is available in enterprise as well as community edition.

Install MongoDB On Windows

To install MongoDB on Windows, first download the latest release of MongoDB from https://www.mongodb.com/try/download/community.

Enter the required details, choose the version of MongoDB, operating system and, packaging as:

Mongodb Community

Now install the downloaded file, by default, it will be installed in the folder C:\Program Files\MongoDB.

By default, MongoDB will be installed as a Service and Installer downloads and installs MongDB Compass as a default GUI (Graphical User Interface).

Once MongoDB server and MongoDB Compass are installed, you can open MongoDB Compass and use the following connectio string to connect to locally installed MongoDB Server.

mongodb://localhost:27017/

Using MongoDB Shell

MongoDB Shell is a Command Line Tool and is a quickest way to connect to MongoDB. It is a standalone tool from MongoDB Server and is open source licensed under Apache 2.0.

Download MongoDB shell using https://www.mongodb.com/try/download/shell.

Mongodb Shell

We've downloaded mongosh-2.5.10-win32-x64.zip and extracted it to D:\mongosh-2.5.10-win32-x64 folder. Open mongosh application from D:\mongosh-2.5.10-win32-x64\bin folder. It will open a command prompt which initially prompt to connect to local mongodb instance.

D:\mongosh-2.5.10-win32-x64\bin>mongosh
Current Mongosh Log ID: 6969f1784daa1172e11e2620
Connecting to:          mongodb://127.0.0.1:27017/?directConnection=true&serverSelectionTimeoutMS=2000&appName=mongosh+2.5.10
Using MongoDB:          8.2.3
Using Mongosh:          2.5.10
mongosh 2.6.0 is available for download: https://www.mongodb.com/try/download/shell

For mongosh info see: https://www.mongodb.com/docs/mongodb-shell/

------
   The server generated these startup warnings when booting
   2026-01-12T12:37:51.203+05:30: Access control is not enabled for the database. Read and write access to data and configuration is unrestricted
------

test>
Advertisements