mongo2md is a command line tool for MongoDB documentation generation It generates mock files from Mongo database, allows you to add comments and builds Markdown files
Contents
- Database schema identification
- Mock files generation
- Build-in Markdown generation
- Low memory footprint
- Documentation
- Test coverage
On macOS, undatum can be installed via Homebrew (recommended):
$ brew install mongo2md
A MacPorts port is also available:
$ port install mongo2md
Most Linux distributions provide a package that can be installed using the system package manager, for example:
# Debian, Ubuntu, etc.
$ apt install mongo2md
# Fedora
$ dnf install mongo2md
# CentOS, RHEL, ...
$ yum install mongo2md
# Arch Linux
$ pacman -S mongo2md
A universal installation method (that works on Windows, Mac OS X, Linux, …, and always provides the latest version) is to use pip:
# Make sure we have an up-to-date version of pip and setuptools:
$ pip install --upgrade pip setuptools
$ pip install --upgrade mongo2md
(If pip
installation fails for some reason, you can try
easy_install mongo2md
as a fallback.)
Python version 3.6 or greater is required.
Synopsis:
$ mongo2md [flags] prepare dbname [collname]
See also mongo2md --help
.
- Run mongo2md prepare command with selected database
- Go to the directory with generated files
- Edit '*_fields.csv' and 'tables.csv' files, add "displayName" and "description" fields. Make sure to use utf -8
- Run python -m mongo2md document will generate Markdown files for
Build mock files from 'budgetreg' database with 'budgetreg' collection and store to 'projects/budgetreg' directory
$ mongo2md prepare --output projects/budgetreg budgetreg budgetreg
Builds markdown
$ mongo2md document projects/budgetreg