How to install Mongo DB on Anaconda?

First of all update conda if you haven’t done so in the past few days.
Download and install

https://www.mongodb.com/dr/fastdl.mongodb.org/win32/mongodb-win32-x86_64-2008plus-ssl-4.0.7-signed.msi/download

Then install it.

Open a command prompt, Navigate to the Scripts directory under Anaconda installation and then type

conda update conda

Then conda update anaconda

conda install -c anaconda mongodb

conda install -c anaconda pymongo

 

 

 

 

Now, start Spyder and type the following program and run it. MongoDB is up and running.


from pymongo import MongoClient
client = MongoClient("mongodb://localhost:27017/")
mydb = client["champakdb"]
print(client.list_database_names())

The output:

[‘admin’, ‘champakdb’, ‘config’, ‘local’]

 

Leave a Reply