Giter Club home page Giter Club logo

mongodoc's Introduction

If you have a mongodb database that you wish to document, a good starting point might be to install mongodoc and use the mongodoc command:

% mongodoc test

After answering a few questions, you will get an output file that will look something like this:

       _____________________________________________
      | hobbies                                     |
      |_____________________________________________|
   +--| _id: <class 'bson.objectid.ObjectId'>       |
   |  | title:               <type 'unicode'>       |
   |  |_____________________________________________|
   |
   |   _____________________________________________
   |  | occupations                                 |
   |  |_____________________________________________|
+--+--| _id: <class 'bson.objectid.ObjectId'>       |
|  |  | duties:                 <type 'list'>       |
|  |  | title:               <type 'unicode'>       |
|  |  |_____________________________________________|
|  |
|  |   ____________________________________________________________________________________
|  |  | people                                                                             |
|  |  |____________________________________________________________________________________|
|  |  | _id:        <class 'bson.objectid.ObjectId'>       ________________________________|
|  |  | address:                       <type 'dict'>     | address                        ||
|  |  | first:                      <type 'unicode'>     |________________________________||
|  +--| hobby:      <class 'bson.objectid.ObjectId'>     | number: <type 'unicode'>       ||
|     | last:                       <type 'unicode'>     | state:  <type 'unicode'>       ||
+-----| occupation: <class 'bson.objectid.ObjectId'>     | street: <type 'unicode'>       ||
      |                                                  | zip:    <type 'unicode'>       ||
      |                                                  |________________________________||
      |____________________________________________________________________________________|

The document in the people collection has a sub-document for the value of the address field, so it appears as a box within the people diagram. You will get one of these diagrams for each collection in the db. MongoDoc found that there is a probable link between the _id of occupations and the occupation field of the people doc. If the find links feature is not working for you, you can disable it with the --find-links option

The mongodoc command has a few options for connecting to the db:

% mongodoc -h
usage: mongodoc [-h] [--port PORT] [--host HOST] [--username USERNAME]
              [--password PASSWORD] [--file FILE]
              name

Document a mongo db

positional arguments:
  name                 The name of the mongo db to document

optional arguments:
  -h, --help           show this help message and exit
  --port PORT          The db port number
  --host HOST          The db host
  --username USERNAME  The username for authenticating to the db
  --password PASSWORD  The password for authenticating to the db
  --file FILE          The name of the output file
  --find-links         Enter no if you don't want to find links.

mongodoc's People

Contributors

cswank avatar

Stargazers

Phil Skaroulis avatar  avatar

Watchers

 avatar James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.