0.0.5 • Published 11 years ago

gomon v0.0.5

Weekly downloads
2
License
-
Repository
github
Last release
11 years ago

#gomon

MongoDB shell written in Node.js

Work in Progress

Usage

$ gomon --help

  Usage: gomon [options] [db address]

  Options:

    -h, --help     output usage information
    -V, --version  output the version number
    --port <port>  port to connect to
    --host <host>  server to connect to

  db address:
    foo                     foo database on local machine
    192.169.0.5/foo         foo database on 192.168.0.5 machine
    192.169.0.5:9999/foo    foo database on 192.168.0.5 machine on port 9999
    mongodb://host:port/db  mongo URI

Example

$ gomon mongodb://localhost:27017,hostA:27017,hostB/dev
connecting to mongodb://localhost:27017,hostA:27017,hostB/dev
connected
gomon>

API

  • dbs(): list available databases
  • collections(): list available collections in current database
  • use(): switch databases
  • exit: exits the shell

More to come.

Example:

First we connect to fakehost.

$ gomon --host fakehost
connecting to mongodb://fakehost
connected
gomon>

Next we list the available databases()

gomon> show.dbs
test                    0.203125GB
fake                    0.203125GB
dev                     0.203125GB

Switch to the dev database

gomon> use.dev

For autocompletion, type use.<TAB> to see a list of available databases.

Show the dev database collections

gomon> show.collections
system.indexes
users
products

Get a count of the users collection

gomon> db.users.count(console.log)
gomon> null 392984

Debugging

gomon uses visionmedia/debug to aid with debugging. Enable it like so:

DEBUG=gomon gomon localhost:27017

LICENSE

0.0.5

11 years ago

0.0.4

11 years ago

0.0.3

11 years ago

0.0.2

11 years ago

0.0.1

11 years ago