A simple guide to setting up MongoDB on iOS.
- Objectives:
-
- Install MongoDB on MacBook.
-
- Required Tools:
- Steps (terminal command in blue):
-
- brew update
- brew install mongodb
- Create MongoDB Data directory (/data/db) with updated permission
- $ sudo mkdir -p /data/db
- $ sudo chown <user>/data/db
- Create/open bash_profile
- $ cd to users/<username>
- $ touch .bash_profile # skip if .bash_profile present
- $ open .bash_profile
- Insert command in bash_profile for MongoDB commands to work in terminal
- export MONGO_PATH=/usr/local/mongodb
- export PATH=$PATH:$MONGO_PATH/bin
- Test: Run MongoDB
- terminal 1: mongod
- terminal 2: mongo.
- Install pymongo
- pip install pymongo
-
Further notes
- Most of the guide reference from below two reference.