A GNU/Linux command line tool to dump the contents of a
collection and its associated BSON type information.
Usage:
MongoType Command Line Syntax:
mongotype [<options>] <db>.<collection>
Where:
- "<db>.<collection>" is the required name of the MongoDB collection to process as input.
Options:
General Options:
Short Option | Long Option | Option Description |
---|---|---|
--help | Print help message and exit. | |
-v | --version | Print version string and exit. |
-d | --debug | Generate debugging info. |
-q | --stack | Generate stack debugging info. |
-c | --config | Path to configuration file. Default configuration file: ${HOME}/.mongotype |
MongoDB Server Options:
Short Option | Long Option | Option Description |
---|---|---|
-h | --host | MongoDB server host name. Default: localhost |
-p | --port | MongoDB server port number. Default: 27017 |
Output Format Options:
Short Option | Long Option | Option Description |
---|---|---|
-s | --style | Output Style:
Default: json |
-t | --type | BSON Type:
Default: all |
-f | --scalarfirst | Output an object's scalar elements before any embedded objects or arrays. |
The C++ Code:
MongoType Code Documentation complements of
Compilation & Linking Prerequisites:
- GNU g++ (gcc v4.7.3 or greater, uses --std=c++0`x )
- MongoDB C++ Client Library using the "legacy" branch.
- Boost 1.55.x or greater. This is because of g++ compile option --std=c++0x and issues with TIME_UTC. See MongoDB JIRA Issue SERVER-6340. MongoType will probably compile with Boost 1.50+ with minor backporting.
Eclipse:
-
- Built using Eclipse Kepler, plus:
- Eclipse EGit 3.0.3.201309161630-r
- C/C++ Development Tools, Eclipse CDT 8.2.1.201309180223
- Use File|Import|Git|Projects from Git using the git: repository specification to clone/import this project into Eclipse in one step.