2009-07-21 14:04:43 +02:00
.TH MONGO "1" "June 2009" "10gen" "Mongo Database"
.SH "NAME"
mongo \- the Mongo command\- line tool
.SH "SYNOPSIS"
\fB mongo [\fI OPTIONS\fR ] [\fI DB_ADDRESS\fR ] [\fI FILE+\fR ]\fR
.SH "DESCRIPTION"
.PP
\fB mongo\fR
is a JavaScript shell (with GNU
readline
capabilities). It supports interactive and non\- interactive use. When used interactively, JavaScript can be used to query the database or perform any other function normally available with SpiderMonkey. Database output is displayed in JSON format.
.PP
If JavaScript files are specified on the command line, the shell will run non\- interactively, running each one in sequence and then exiting.
.SH "EXAMPLES"
.TP
.B mongo
start the shell, connecting to the server at localhost:27017 and using the test database
.TP
2010-05-17 21:43:56 +02:00
.B mongo foo
2009-07-21 14:04:43 +02:00
start the shell using the foo database at localhost:27017
.TP
2010-05-17 21:43:56 +02:00
.B mongo 192 .169.0.5/foo
2009-07-21 14:04:43 +02:00
start the shell using the foo database at 192.169.0.5:27017
.TP
2010-05-17 21:43:56 +02:00
.B mongo 192 .169.0.5:9999/foo
2009-07-21 14:04:43 +02:00
start the shell using the foo database at 192.169.0.5:9999
.TP
2010-05-17 21:43:56 +02:00
.B mongo script1.js script2.js script3.js
2009-07-21 14:04:43 +02:00
run three scripts and exit
.SH "OPTIONS"
.TP
.B \- \- shell
run the shell after executing files
.TP
.B \- \- help
show usage information
.TP
.B \- \- host HOST
server to connect to (default HOST=localhost)
.TP
.B \- \- port PORT
port to connect to (default PORT=27017)
.TP
.B \- \- nodb
do not connect to mongod
.TP
.B \- \- eval SCRIPT
evaluate JavaScript
.TP
2011-03-17 19:56:03 +01:00
.B \- \- shell
run the shell after executing files
.TP
.B \- \- quiet
be less chatty
.TP
.B \- \- version
show version information
.TP
.B \- \- verbose
increase verbosity
.TP
.B \- \- ipv6
enable IPv6 support (disabled by default)
.TP
.B \- u|\-\-username USERNAME
2009-07-21 14:04:43 +02:00
specify user to log in as
.TP
2011-03-17 19:56:03 +01:00
.B \- p|\-\-password PASSWORD
specify password of user
2009-07-21 14:04:43 +02:00
.SH "COPYRIGHT"
.PP
2011-03-17 19:56:03 +01:00
Copyright 2007\- 2011 10gen
2009-07-21 14:04:43 +02:00
.SH "SEE ALSO"
For more information, please refer to the MongoDB wiki, available at http://www.mongodb.org.
.SH "AUTHOR"
Kristina Chodorow