0.0.5 • Published 13 years ago
gomon v0.0.5
#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 URIExample
$ gomon mongodb://localhost:27017,hostA:27017,hostB/dev
connecting to mongodb://localhost:27017,hostA:27017,hostB/dev
connected
gomon>API
dbs(): list available databasescollections(): list available collections in current databaseuse(): switch databasesexit: 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.203125GBSwitch to the dev database
gomon> use.devFor autocompletion, type use.<TAB> to see a list of available databases.
Show the dev database collections
gomon> show.collections
system.indexes
users
productsGet a count of the users collection
gomon> db.users.count(console.log)
gomon> null 392984Debugging
gomon uses visionmedia/debug to aid with debugging. Enable it like so:
DEBUG=gomon gomon localhost:27017