monger is a command-line version manager of MongoDB. It downloads and stores version of MongoDB to
the directory ~/.monger and facilitates running different mongodb binaries (mongod
, mongo
, etc.)
by version.
monger
currently only supports Linux and OS X/MacOS
Assuming that you have Rust installed, simply run cargo install monger
. Note that you'll need to
have ~/.cargo/bin
on your PATH to run monger.
To print help info:
monger --help
To print the version:
monger --version
The command monger list
will print out all versions of MongoDB being managed by your installation
of monger, as well as an entry listed as "system" if you have a version of mongod
installed on
your PATH (e.g. from a package manager installation of mongodb).
To download a version of MongoDB, use the commaond monger get <VERSION>
, where
monger get 3.5.12
monger get 3.4.8-rc1
monger get 3.4
monger get latest
By default, this will do nothing if the version of MongoDB is already installed. To force monger to
download and install the verison of MongoDB from scratch, add --force
:
monger get 3.4.7 --force
To start mongod, run monger start <VERSION>
, where mongod
is present in the user's PATH:
monger start 3.5.12
monger start 3.4.8-rc1
monger start system
To specify additional arguments to mongod
, simply append --
:
monger start 3.4.7 -- --fork --syslog
NOTE: Currently, --dbpath will be set to the directory ~/.monger/db/<VERSION>
. This can't
currently be overridden, although in the future this will be fixed so that users can specific a
non-default path.
To run a MongoDB binary, run monger run <VERSION> <BIN>
, where mongod
is present in the
user's PATH and
monger run 3.5.12 mongo
monger run 3.4.8-rc1 mongotop
To specify additional arguments to mongod
, simply append --
:
monger run 3.4.7 mongo -- --host 1.2.3.4 --port 1234
To delete a version of MongoDB managed by monger, run monger delete <VERSION>
, where
monger delete 3.5.12
monger delete 3.4.8-rc1
monger start
/monger run
(e.g. monger start 3.4
)