app.adm_mongo - MongoDB storage administration¶
Some kinds of solution items are stored in a separated storage on the server side, in Mongo DB instance. The administration utility app.adm_mongo is used to view, dump, restore and clean up this information.
The system used Mongo DB storage in a very soft ant flexible manner:
The can be a situation when a dataset is present but not registered on Mongo DB level; it just means that there is no specific information on dataset that was stored in Mongo DB
Vice versa: there can be a dataset registered in Mongo DB but not present in the system; it means that a dataset with this name existed some time before in the system, some specific information on this dataset was stored in Mongo DB, but later the dataset was removed.
In practice, these flexible features of Mongo DB layer are useful. Especially in case of re-creation of dataset by new version of data. But sometimes there can be a need to make clean up procedure in Mongo DB layer, and the utility provides mode drop for it.
The utility output is data of JSON format, or multiple JSON records, one per line. In case of use option --pretty the output is formally incorrect, so use this option only for view purposes.
Here are the options of the utility:
$ cd $ANFISA_HOME
$ python -m app.adm_mongo --help
usage: adm_mongo.py [-h] [-c CONFIG] [-a ASPECTS] [--pretty] [--dry] [-m MODE]
[datasets [datasets ...]]
positional arguments:
datasets Dataset names or pattern with '*'
optional arguments:
-h, --help show this help message and exit
-c CONFIG, --config CONFIG
Anfisa config file
-a ASPECTS, --aspects ASPECTS
Aspects: All/Filter/Dtree/Tags/Info
--pretty Pretty JSON print
--dry Dry run: just report instead of data change
-m MODE, --mode MODE Command: list/dump/restore/drop/GeneDb
Comments on options¶
--config option: path to Configuration service: anfisa.json
--aspects There are 4 kinds of information that are stored in Mongo DB in the current version of the system. On level of the utility they form aspects of information, distinguished by single capital letters:
--mode
--pretty option affects only dump mode, and makes output readable, do not use this option to store in files and further attempts to use restore mode
--dry option, affects only in restore mode: does not perform real restore operation but reports (to standard error stream) on all the changes in data