We would explain the installation of MongoDB in steps. Before you install, I would suggest everyone use ide spyder, Anaconda.
Step 1 -> Install the community Edition Installation Link
Step 2 -> Run the installed MongoDB windows installer package that you just downloaded. MongoDB get installed here->
C:\Program Files\MongoDB\Server\3.4\
Step 3 -> Let’s set MongoDB environment
- (a) Create data directory where all data is stored. On C: drive create a folder data inside it create a folder db or Run
md C:\data\db
- (b) To start MongoDB Run ->
"C:\Program Files\MongoDB\Server\3.4\bin\mongod.exe"
- Wait till the connection message appears
- (c) Verify Environment Path or set path if not correctly set Open environment variables, you can search this by windows search.
Open Environment Variable under the System variables section open Path. This would look like this. Add the path of bin folder as shown in the image above. - (d) To Connect to MongoDB Open other command prompt and run->
"C:\Program Files\MongoDB\Server\3.4\bin\mongo.exe
Step 4-> Ready MongoDB Open Command Prompt(Admin mode) type->
mongod
mkdir c:\data\db mkdir c:\data\log
Step 6-> Create a configuration file at C:\Program Files\MongoDB\Server\3.4\mongod.cfg (name of file mongod.cfg)
systemLog: destination: file path: c:\data\log\mongod.log storage: dbPath: c:\data\db
This can be created and saved in Admin mode of Notepad or Notepad++ or any other editor to run notepad admin mode press Ctrl + Shift + Enter. Admin mode of notepad will let you create mongod.cfg and save above text file. Step 7 -> Install the MongoDB service by starting mongod.exe with the –install option and the -config option to specify the previously created configuration file. Now run this command on command prompt
"C:\Program Files\MongoDB\Server\3.4\bin\mongod.exe" --config "C:\Program Files\MongoDB\Server\3.4\mongod.cfg" --install
Step 8-> To start & stop MongoDB run To start :
net start MongoDB
To stop :
net stop MongoDB
conda install -c anaconda pymongo