1MONGO(1)                        Mongo Database                        MONGO(1)
2
3
4

NAME

6       mongo - the Mongo command-line tool
7

SYNOPSIS

9       mongo [OPTIONS] [DB_ADDRESS] [FILE+]
10

DESCRIPTION

12       mongo  is a JavaScript shell (with GNU readline capabilities).  It sup‐
13       ports interactive and non-interactive use.   When  used  interactively,
14       JavaScript can be used to query the database or perform any other func‐
15       tion normally available with SpiderMonkey.   Database  output  is  dis‐
16       played in JSON format.
17
18       If  JavaScript  files are specified on the command line, the shell will
19       run non-interactively, running each one in sequence and then exiting.
20

EXAMPLES

22       mongo  start the shell, connecting to the server at localhost:27017 and
23              using the test database
24
25       mongo foo
26              start the shell using the foo database at localhost:27017
27
28       mongo 192.169.0.5/foo
29              start the shell using the foo database at 192.169.0.5:27017
30
31       mongo 192.169.0.5:9999/foo
32              start the shell using the foo database at 192.169.0.5:9999
33
34       mongo script1.js script2.js script3.js
35              run three scripts and exit
36

OPTIONS

38       --shell
39              run the shell after executing files
40
41       --help show usage information
42
43       --host HOST
44              server to connect to (default HOST=localhost)
45
46       --port PORT
47              port to connect to (default PORT=27017)
48
49       --nodb do not connect to mongod
50
51       --eval SCRIPT
52              evaluate JavaScript
53
54       -u USERNAME
55              specify user to log in as
56
57       -pPASSWORD
58              specify password of user (notice there is no space)
59
61       Copyright 2007-2009 10gen
62

SEE ALSO

64       For  more  information,  please refer to the MongoDB wiki, available at
65       http://www.mongodb.org.
66

AUTHOR

68       Kristina Chodorow
69
70
71
7210gen                              June 2009                          MONGO(1)
Impressum