-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy path_mongodump
46 lines (43 loc) · 2.97 KB
/
_mongodump
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#compdef mongodump
verbose_values=( 1 2 3 4 5 )
_arguments -S \
"--help[Show this usage information]" \
"--version[Show version information]" \
"--verbose=[More detailed log output (specify a numeric value from 1 to 5)]:arg:_values 'verbose' $verbose_values" \
"--quiet[Hide all log output]" \
{-h,--host}"[Server to connect to]:arg:(localhost)" \
"--port[Port to connect to]:arg:(27017)" \
"--ssl[Use SSL for all connections]" \
"--sslCAFile=[Certificate authority file for SSL]:filename:_files" \
"--sslPEMKeyFile=[PEM certificate/key file for SSl]:filename:_files" \
"--sslPEMKeyPassword=[Password for key in PEM file for SSL]:arg:" \
"--sslCRLFile=[Certificate revocation list file for SSL]:filename:_files" \
"--sslAllowInvalidHostnames[Allow connections to servers with non-matching hostnames]" \
"--sslAllowInvalidCertificates[Allow connections to servers with invalid certificates]" \
"--sslFIPSMode[Activate FIPS 140-2 mode at startup]" \
{-u,--username}"[Username for authentication]:arg:" \
{-p,--password}"[Password for authentication]:arg:" \
"--authenticationDatabase=[User source (defaults to dbname)]:arg:(admin)" \
"--authenticationMechanism=[Authentication mechanism]:arg:(SCRAM-SHA-256)" \
"--awsSessionToken=[Session token to authenticate via AWS IAM]:arg:" \
"--gssapiServiceName=[Service name to use when authenticating using GSSAPI/Kerberos]:arg:" \
"--gssapiHostName=[Remote host name to use for purpose of GSSAPI/Kerberos authentication]:arg:" \
"--uri=[MongoDB URI connection string]:arg:" \
{-d,--db}"[Database to use]:database:" \
{-c,--collection}"[Collection to use]:arg:" \
{-q,--query}"[Query filter, as a JSON string, e.g., '{x:{$gt:1}}']:arg:" \
"--queryFile=[Path to a file containing a query filter (JSON)]:filename:_files:" \
"--readPreference=[Specify either a preference name or a preference json object]:arg:" \
"--forceTableScan[Force a table scan]" \
{-o,--out}"[Output directory, or '-' for stdout (defaults to 'dump')]:directory:_files -/" \
"--gzip[Compress archive or collection output with Gzip]" \
"--repair[Try to recover documents from damaged data files (not supported by all storage engines)]" \
"--oplog[Use oplog for taking a point-in-time snapshot]" \
"--archive=[Dump as an archive to the specified path. If flag is specified without a value, archive is written to stdout]:filename:_files:" \
"--dumpDbUsersAndRoles[Dump user and role definitions for the specified database]" \
"--excludeCollection=[Collection to exclude from the dump (may be specified multiple times to exclude additional collections)]" \
"--excludeCollectionsWithPrefix=[Exclude all collections from the dump that have the given prefix (may be specified multiple times to exclude additional prefixes)]" \
{-j,--numParallelCollections}"[Number of collections to dump in parallel (default: 4)]:arg:(4)" \
"--viewsAsCollections[Dump views as normal collections with their produced data, omitting standard collections]" \
&& return 0
return 1