1 General mongod options: 2 -v [ --verbose ] [=arg(=v)] be more verbose (include multiple times 3 for more verbosity e.g. -vvvvv) 4 --quiet quieter output 5 --port arg specify port number - 27017 by default 6 --logpath arg log file to send write to instead of 7 stdout - has to be a file, not 8 directory 9 --logappend append to logpath instead of 10 over-writing 11 --logRotate arg set the log rotation behavior 12 (rename|reopen) 13 --timeStampFormat arg Desired format for timestamps in log 14 messages. One of ctime, iso8601-utc or 15 iso8601-local 16 --setParameter arg Set a configurable parameter 17 -h [ --help ] show this usage information 18 --version show version information 19 -f [ --config ] arg configuration file specifying 20 additional options 21 --bind_ip arg comma separated list of ip addresses to 22 listen on - localhost by default 23 --bind_ip_all bind to all ip addresses 24 --ipv6 enable IPv6 support (disabled by 25 default) 26 --listenBacklog arg (=2147483647) set socket listen backlog size 27 --maxConns arg max number of simultaneous connections 28 - 1000000 by default 29 --pidfilepath arg full path to pidfile (if not set, no 30 pidfile is created) 31 --timeZoneInfo arg full path to time zone info directory, 32 e.g. /usr/share/zoneinfo 33 --keyFile arg private key for cluster authentication 34 --noauth run without security 35 --transitionToAuth For rolling access control upgrade. 36 Attempt to authenticate over outgoing 37 connections and proceed regardless of 38 success. Accept incoming connections 39 with or without authentication. 40 --clusterAuthMode arg Authentication mode used for cluster 41 authentication. Alternatives are 42 (keyFile|sendKeyFile|sendX509|x509) 43 --slowms arg (=100) value of slow for profile and console 44 log 45 --slowOpSampleRate arg (=1) fraction of slow ops to include in the 46 profile and console log 47 --networkMessageCompressors [=arg(=disabled)] (=snappy) 48 Comma-separated list of compressors to 49 use for network messages 50 --auth run with security 51 --clusterIpSourceWhitelist arg Network CIDR specification of permitted 52 origin for `__system` access. 53 --profile arg 0=off 1=slow, 2=all 54 --cpu periodically show cpu and iowait 55 utilization 56 --sysinfo print some diagnostic system 57 information 58 --noIndexBuildRetry don't retry any index builds that were 59 interrupted by shutdown 60 --noscripting disable scripting engine 61 --notablescan do not allow table scans 62 63 Windows Service Control Manager options: 64 --install install Windows service 65 --remove remove Windows service 66 --reinstall reinstall Windows service (equivalent 67 to --remove followed by --install) 68 --serviceName arg Windows service name 69 --serviceDisplayName arg Windows service display name 70 --serviceDescription arg Windows service description 71 --serviceUser arg account for service execution 72 --servicePassword arg password used to authenticate 73 serviceUser 74 75 Replication options: 76 --oplogSize arg size to use (in MB) for replication op 77 log. default is 5% of disk space (i.e. 78 large is good) 79 --master Master/slave replication no longer 80 supported 81 --slave Master/slave replication no longer 82 supported 83 84 Replica set options: 85 --replSet arg arg is <setname>[/<optionalseedhostlist 86 >] 87 --replIndexPrefetch arg specify index prefetching behavior (if 88 secondary) [none|_id_only|all] 89 --enableMajorityReadConcern [=arg(=1)] (=1) 90 enables majority readConcern 91 92 Sharding options: 93 --configsvr declare this is a config db of a 94 cluster; default port 27019; default 95 dir /data/configdb 96 --shardsvr declare this is a shard db of a 97 cluster; default port 27018 98 99 SSL options: 100 --sslOnNormalPorts use ssl on configured ports 101 --sslMode arg set the SSL operation mode 102 (disabled|allowSSL|preferSSL|requireSSL 103 ) 104 --sslPEMKeyFile arg PEM file for ssl 105 --sslPEMKeyPassword arg PEM file password 106 --sslClusterFile arg Key file for internal SSL 107 authentication 108 --sslClusterPassword arg Internal authentication key file 109 password 110 --sslCAFile arg Certificate Authority file for SSL 111 --sslClusterCAFile arg CA used for verifying remotes during 112 outbound connections 113 --sslCRLFile arg Certificate Revocation List file for 114 SSL 115 --sslDisabledProtocols arg Comma separated list of TLS protocols 116 to disable [TLS1_0,TLS1_1,TLS1_2] 117 --sslWeakCertificateValidation allow client to connect without 118 presenting a certificate 119 --sslAllowConnectionsWithoutCertificates 120 allow client to connect without 121 presenting a certificate 122 --sslAllowInvalidHostnames Allow server certificates to provide 123 non-matching hostnames 124 --sslAllowInvalidCertificates allow connections to servers with 125 invalid certificates 126 --sslFIPSMode activate FIPS 140-2 mode at startup 127 --sslCertificateSelector arg SSL Certificate in system store 128 --sslClusterCertificateSelector arg SSL Certificate in system store for 129 internal SSL authentication 130 131 Storage options: 132 --storageEngine arg what storage engine to use - defaults 133 to wiredTiger if no data files present 134 --dbpath arg directory for datafiles - defaults to 135 \data\db\ which is C:\data\db\ based on 136 the current working drive 137 --directoryperdb each database will be stored in a 138 separate directory 139 --noprealloc disable data file preallocation - will 140 often hurt performance 141 --nssize arg (=16) .ns file size (in MB) for new databases 142 --quota limits each database to a certain 143 number of files (8 default) 144 --quotaFiles arg number of files allowed per db, implies 145 --quota 146 --smallfiles use a smaller default file size 147 --syncdelay arg (=60) seconds between disk syncs (0=never, 148 but not recommended) 149 --upgrade upgrade db if needed 150 --repair run repair on all dbs 151 --repairpath arg root directory for repair files - 152 defaults to dbpath 153 --journal enable journaling 154 --nojournal disable journaling (journaling is on by 155 default for 64 bit) 156 --journalOptions arg journal diagnostic options 157 --journalCommitInterval arg how often to group/batch commit (ms) 158 159 Free Monitoring options: 160 --enableFreeMonitoring arg Enable Cloud Free Monitoring 161 (on|runtime|off) 162 --freeMonitoringTag arg Cloud Free Monitoring Tags 163 164 WiredTiger options: 165 --wiredTigerCacheSizeGB arg maximum amount of memory to allocate 166 for cache; defaults to 1/2 of physical 167 RAM 168 --wiredTigerJournalCompressor arg (=snappy) 169 use a compressor for log records 170 [none|snappy|zlib] 171 --wiredTigerDirectoryForIndexes Put indexes and data in different 172 directories 173 --wiredTigerCollectionBlockCompressor arg (=snappy) 174 block compression algorithm for 175 collection data [none|snappy|zlib] 176 --wiredTigerIndexPrefixCompression arg (=1) 177 use prefix compression on row-store 178 leaf pages 179 180 MongoDB shell version v4.0.6 181 usage: mongo [options] [db address] [file names (ending in .js)] 182 db address can be: 183 foo foo database on local machine 184 192.168.0.5/foo foo database on 192.168.0.5 machine 185 192.168.0.5:9999/foo foo database on 192.168.0.5 machine on port 9999 186 Options: 187 --shell run the shell after executing files 188 --nodb don't connect to mongod on startup - no 189 'db address' arg expected 190 --norc will not run the ".mongorc.js" file on 191 start up 192 --quiet be less chatty 193 --port arg port to connect to 194 --host arg server to connect to 195 --eval arg evaluate javascript 196 -h [ --help ] show this usage information 197 --version show version information 198 --verbose increase verbosity 199 --ipv6 enable IPv6 support (disabled by default) 200 --disableJavaScriptJIT disable the Javascript Just In Time 201 compiler 202 --enableJavaScriptJIT enable the Javascript Just In Time 203 compiler 204 --disableJavaScriptProtection allow automatic JavaScript function 205 marshalling 206 --ssl use SSL for all connections 207 --sslCAFile arg Certificate Authority file for SSL 208 --sslPEMKeyFile arg PEM certificate/key file for SSL 209 --sslPEMKeyPassword arg password for key in PEM file for SSL 210 --sslCRLFile arg Certificate Revocation List file for SSL 211 --sslAllowInvalidHostnames allow connections to servers with 212 non-matching hostnames 213 --sslAllowInvalidCertificates allow connections to servers with invalid 214 certificates 215 --sslFIPSMode activate FIPS 140-2 mode at startup 216 --sslCertificateSelector arg SSL Certificate in system store 217 --sslDisabledProtocols arg Comma separated list of TLS protocols to 218 disable [TLS1_0,TLS1_1,TLS1_2] 219 --retryWrites automatically retry write operations upon 220 transient network errors 221 --disableImplicitSessions do not automatically create and use 222 implicit sessions 223 --jsHeapLimitMB arg set the js scope's heap size limit 224 225 Authentication Options: 226 -u [ --username ] arg username for authentication 227 -p [ --password ] arg password for authentication 228 --authenticationDatabase arg user source (defaults to dbname) 229 --authenticationMechanism arg authentication mechanism 230 --gssapiServiceName arg (=mongodb) Service name to use when authenticating 231 using GSSAPI/Kerberos 232 --gssapiHostName arg Remote host name to use for purpose of 233 GSSAPI/Kerberos authentication 234 235 file names: a list of files to run. files have to end in .js and will exit after 236 unless --shell is specified