Setting up the database environment
Before we start discussing the application’s database connectivity, we need to download the appropriate MongoDB database server from https://www.mongodb.com/try/download/community. online book reselling system uses MongoDB 5.0.5 for a Windows platform. The installation will provide default service configuration details for the service name, data directory, and log directory. However, it is advised that you use different directory paths instead of the default ones.
After the installation, we can start the MongoDB server by running /bin/mongod.exe
. This will automatically create a database directory called /data/db
in the C:/
drive (Windows). We can place the /data/db
directory in some other location, but be sure to run the mongod
command with the --dbpath
option while specifying <new path>/data/db
.
The MongoDB platform has utilities that can aid in managing database collections, and one of them is MongoDB Compass. It can provide...