View on GitHub MongoType
https://github.com/krystalmonolith/MongoType
Download this project as a .zip file Download this project as a tar.gz file

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
--helpPrint help message and exit.
-v--versionPrint version string and exit.
-d--debugGenerate debugging info.
-q--stackGenerate stack debugging info.
-c--configPath to configuration file. Default configuration file: ${HOME}/.mongotype
MongoDB Server Options:
Short
Option
Long
Option
Option
Description
-h--hostMongoDB server host name. Default: localhost
-p--portMongoDB server port number. Default: 27017
Output Format Options:
Short
Option
Long
Option
Option
Description
-s--styleOutput Style:
  • dotted
  • tree
  • json
  • jsonpacked

Default: json
-t--typeBSON Type:
  • none
  • name
  • desc
  • code
  • all

Default: all
-f--scalarfirstOutput 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.

License:

Free Software Foundation’s GNU AGPL v3.0.

Links: