Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

63 lines (62 sloc) 1.756 kB
.\" Documentation for the MongoDB shell
.TH MONGO "1" "June 2009" "10gen" "Mongo Database"
mongo \- the Mongo command\-line tool
\fBmongo [\fIOPTIONS\fR] [\fIDB_ADDRESS\fR] [\fIFILE+\fR]\fR
is a JavaScript shell (with GNU
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.
If JavaScript files are specified on the command line, the shell will run non\-interactively, running each one in sequence and then exiting.
.B mongo
start the shell, connecting to the server at localhost:27017 and using the test database
.B mongo foo
start the shell using the foo database at localhost:27017
.B mongo
start the shell using the foo database at
.B mongo
start the shell using the foo database at
.B mongo script1.js script2.js script3.js
run three scripts and exit
.B \-\-shell
run the shell after executing files
.B \-\-help
show usage information
.B \-\-host HOST
server to connect to (default HOST=localhost)
.B \-\-port PORT
port to connect to (default PORT=27017)
.B \-\-nodb
do not connect to mongod
.B \-\-eval SCRIPT
evaluate JavaScript
specify user to log in as
specify password of user (notice there is no space)
Copyright 2007\-2009 10gen
For more information, please refer to the MongoDB wiki, available at
Kristina Chodorow
Jump to Line
Something went wrong with that request. Please try again.