-
use
pip
$ pip install mongoladdu
-
from source code
$ python setup.py install
- create folder named
migrations
- create
config.yml
file with inmigrations
folder and place your environment specific configurations
dev:
host: localhost
port: 27017
db_name: dev_db
- create migration scripts with in
migrations
folder. file names should follow patter<index>_<description>.py
def run(db):
db.Test.insert({'name': 'value'})
- run migrate
mongoladdu <env> run
mongoladdu dev run
- Alternate options for providing configuration
can be directly invoked from python code using, MongoLaddu().run_for_config('localhost', 27017, 'dev_db')