Installations to run Jupyter notebooks from https://github.com/thedatasociety/lab-mongodb on Windows 10.
IDE: VS Code - https://code.visualstudio.com/
Installations:
- Install VS Code;
- Install Python;
- Install MongoDB;
- https://www.mongodb.com/;
- include the path for VS Code have access to mongo;
- (Windows) System Properties [window] > Environment Variables [button] > Path [option] > Edit [button] > New [button] > "C:\Program Files\MongoDB\Server\4.4\bin" [paste];
- (OPTIONAL) MongoDB Compass Community;
- IDE to access mongodb instance - optional but usefull;
- MongoDB installation asks for install it;
- Install Pyhton extension on VS Code;
ms-python.python
- Install MongoDB tools;
- necessary for mongoimport;
- register the path for VS Code have access to the tools;
- (Windows) System Properties [window] > Environment Variables [button] > Path [option] > Edit [button] > New [button] > "C:\Program Files\MongoDB\Tools\100\bin" [paste];
- Jupyter notebooks could require some python libraries;
- on VS Code > Terminal [menu] > New Terminal [option];
- execute the pip installations;
- e.g.:
pip install pymongo
;pip install pprintpp
;
- e.g.:
- For
Exercicio 2 [pt-br].ipynb
it needs to import the database:- bsondump is part of MongoDB tools (installed on Step 7);
- execute bsondump on ..\lab-mongodb-master\resources\datasets\quick-mongo-atlas-datasets\dump\sample_mflix
bsondump --outFile=movies.json movies.bson
- copy the file movies.json to ..\lab-mongodb\labs (same directory from restaurants.json from
Exercicio 1 [pt-br].ipynb
)
- After generated the movies.json import to mongodb:
- adding as a step on the notebook:
mongoimport --db exercicio2 --collection movies --drop --file ./movies.json
- adding as a step on the notebook:
O Python.extension já tráz o Jupiter Notebook.