mongoclean-cli
v0.0.6
Published
A KISS cli to clean a mongodb
Downloads
6
Readme
mongoclean-cli
Clean all the collections in a mongo database thru the CLI. This is actually a simple wrapper for the excelent mongo-clean
Install
$ npm install mongoclean-cli --save-dev
Usage
$ mongoclean-cli -h
Usage:
mongoclean-cli [OPTIONS] [ARGS]
Options:
-u, --url [STRING] The URL for the mongoDB || MONGO_HOST env (Default is mongodb://localhost)
-p, --port [NUMBER] The PORT for the mongoDB || MONGO_PORT env (Default is 27017)
-d, --db [STRING] The name for the DB || MONGO_NAME env (Default is test)
-h, --help Display help and usage details
It uses dotenv, so be careful if you have a .env file in your current working directory (${PWD})
A simple way to use it is to call it in your test script before running the actual test tool.
"scripts": {
"test": "cp .env.test .env && mongoclean-cli && mocha"
},
or
"scripts": {
"test": "mongoclean-cli -h mongodb://my-mongodb-host -p 1234 -d testdb && mocha"
},
License
MIT
PR && Issues
... are welcome