Blame SOURCES/mongofiles.1

c34f3f
.\" Man page generated from reStructuredText.
c34f3f
.
c34f3f
.TH "MONGOFILES" "1" "January 30, 2015" "3.0" "mongodb-manual"
c34f3f
.SH NAME
c34f3f
mongofiles \- MongoDB GridFS Utility
c34f3f
.
c34f3f
.nr rst2man-indent-level 0
c34f3f
.
c34f3f
.de1 rstReportMargin
c34f3f
\\$1 \\n[an-margin]
c34f3f
level \\n[rst2man-indent-level]
c34f3f
level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
c34f3f
-
c34f3f
\\n[rst2man-indent0]
c34f3f
\\n[rst2man-indent1]
c34f3f
\\n[rst2man-indent2]
c34f3f
..
c34f3f
.de1 INDENT
c34f3f
.\" .rstReportMargin pre:
c34f3f
. RS \\$1
c34f3f
. nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin]
c34f3f
. nr rst2man-indent-level +1
c34f3f
.\" .rstReportMargin post:
c34f3f
..
c34f3f
.de UNINDENT
c34f3f
. RE
c34f3f
.\" indent \\n[an-margin]
c34f3f
.\" old: \\n[rst2man-indent\\n[rst2man-indent-level]]
c34f3f
.nr rst2man-indent-level -1
c34f3f
.\" new: \\n[rst2man-indent\\n[rst2man-indent-level]]
c34f3f
.in \\n[rst2man-indent\\n[rst2man-indent-level]]u
c34f3f
..
c34f3f
.SH SYNOPSIS
c34f3f
.sp
c34f3f
The \fBmongofiles\fP utility makes it possible to manipulate files
c34f3f
stored in your MongoDB instance in \fIGridFS\fP objects from the
c34f3f
command line. It is particularly useful as it provides an interface
c34f3f
between objects stored in your file system and GridFS.
c34f3f
.sp
c34f3f
All \fBmongofiles\fP commands have the following form:
c34f3f
.INDENT 0.0
c34f3f
.INDENT 3.5
c34f3f
.sp
c34f3f
.nf
c34f3f
.ft C
c34f3f
mongofiles <options> <commands> <filename>
c34f3f
.ft P
c34f3f
.fi
c34f3f
.UNINDENT
c34f3f
.UNINDENT
c34f3f
.sp
c34f3f
The components of the \fBmongofiles\fP command are:
c34f3f
.INDENT 0.0
c34f3f
.IP 1. 3
c34f3f
\fI\%Options\fP\&. You may use one or more of
c34f3f
these options to control the behavior of \fBmongofiles\fP\&.
c34f3f
.IP 2. 3
c34f3f
\fI\%Commands\fP\&. Use one of these commands to
c34f3f
determine the action of \fBmongofiles\fP\&.
c34f3f
.IP 3. 3
c34f3f
A filename which is either: the name of a file on your local\(aqs file
c34f3f
system, or a GridFS object.
c34f3f
.UNINDENT
c34f3f
.sp
c34f3f
\fBmongofiles\fP, like \fBmongodump\fP, \fBmongoexport\fP,
c34f3f
\fBmongoimport\fP, and \fBmongorestore\fP, can access data
c34f3f
stored in a MongoDB data directory without requiring a running
c34f3f
\fBmongod\fP instance, if no other \fBmongod\fP is running.
c34f3f
.sp
c34f3f
\fBIMPORTANT:\fP
c34f3f
.INDENT 0.0
c34f3f
.INDENT 3.5
c34f3f
For \fIreplica sets\fP,
c34f3f
\fBmongofiles\fP can only read from the set\(aqs
c34f3f
\(aq\fIprimary\fP\&.
c34f3f
.UNINDENT
c34f3f
.UNINDENT
c34f3f
.SH OPTIONS
c34f3f
.sp
c34f3f
Changed in version 3.0.0: \fBmongofiles\fP removed the \fB\-\-dbpath\fP as well as related
c34f3f
\fB\-\-directoryperdb\fP and \fB\-\-journal\fP options. You must use
c34f3f
\fBmongofiles\fP while connected to a \fBmongod\fP instance.
c34f3f
c34f3f
.INDENT 0.0
c34f3f
.TP
c34f3f
.B mongofiles
c34f3f
.UNINDENT
c34f3f
.INDENT 0.0
c34f3f
.TP
c34f3f
.B \-\-help
c34f3f
Returns information on the options and use of \fBmongofiles\fP\&.
c34f3f
.UNINDENT
c34f3f
.INDENT 0.0
c34f3f
.TP
c34f3f
.B \-\-verbose, \-v
c34f3f
Increases the amount of internal reporting returned on standard output
c34f3f
or in log files. Increase the verbosity with the \fB\-v\fP form by
c34f3f
including the option multiple times, (e.g. \fB\-vvvvv\fP\&.)
c34f3f
.UNINDENT
c34f3f
.INDENT 0.0
c34f3f
.TP
c34f3f
.B \-\-quiet
c34f3f
Runs the \fBmongofiles\fP in a quiet mode that attempts to limit the amount
c34f3f
of output.
c34f3f
.sp
c34f3f
This option suppresses:
c34f3f
.INDENT 7.0
c34f3f
.IP \(bu 2
c34f3f
output from \fIdatabase commands\fP
c34f3f
.IP \(bu 2
c34f3f
replication activity
c34f3f
.IP \(bu 2
c34f3f
connection accepted events
c34f3f
.IP \(bu 2
c34f3f
connection closed events
c34f3f
.UNINDENT
c34f3f
.UNINDENT
c34f3f
.INDENT 0.0
c34f3f
.TP
c34f3f
.B \-\-version
c34f3f
Returns the \fBmongofiles\fP release number.
c34f3f
.UNINDENT
c34f3f
.INDENT 0.0
c34f3f
.TP
c34f3f
.B \-\-host <hostname><:port>
c34f3f
Specifies a resolvable hostname for the \fBmongod\fP that holds
c34f3f
your GridFS system. By default \fBmongofiles\fP attempts to connect
c34f3f
to a MongoDB process running on the localhost port number \fB27017\fP\&.
c34f3f
.sp
c34f3f
Optionally, specify a port number to connect a MongoDB instance running
c34f3f
on a port other than 27017.
c34f3f
.UNINDENT
c34f3f
.INDENT 0.0
c34f3f
.TP
c34f3f
.B \-\-port <port>
c34f3f
\fIDefault\fP: 27017
c34f3f
.sp
c34f3f
Specifies the TCP port on which the MongoDB instance listens for
c34f3f
client connections.
c34f3f
.UNINDENT
c34f3f
.INDENT 0.0
c34f3f
.TP
c34f3f
.B \-\-ipv6
c34f3f
Enables IPv6 support and allows the \fBmongofiles\fP to connect to the
c34f3f
MongoDB instance using an IPv6 network. All MongoDB programs and
c34f3f
processes disable IPv6 support by default.
c34f3f
.UNINDENT
c34f3f
.INDENT 0.0
c34f3f
.TP
c34f3f
.B \-\-ssl
c34f3f
New in version 2.6.
c34f3f
c34f3f
.sp
c34f3f
Enables connection to a \fBmongod\fP or \fBmongos\fP that has
c34f3f
SSL support enabled.
c34f3f
.sp
c34f3f
The default distribution of MongoDB does not contain support for SSL.
c34f3f
For more information on MongoDB and SSL, see http://docs.mongodb.org/manual/tutorial/configure\-ssl\&.
c34f3f
.UNINDENT
c34f3f
.INDENT 0.0
c34f3f
.TP
c34f3f
.B \-\-sslCAFile <filename>
c34f3f
New in version 2.6.
c34f3f
c34f3f
.sp
c34f3f
Specifies the \fB\&.pem\fP file that contains the root certificate chain
c34f3f
from the Certificate Authority. Specify the file name of the
c34f3f
\fB\&.pem\fP file using relative or absolute paths.
c34f3f
.sp
c34f3f
The default distribution of MongoDB does not contain support for SSL.
c34f3f
For more information on MongoDB and SSL, see http://docs.mongodb.org/manual/tutorial/configure\-ssl\&.
c34f3f
.sp
c34f3f
\fBWARNING:\fP
c34f3f
.INDENT 7.0
c34f3f
.INDENT 3.5
c34f3f
If the \fBmongo\fP shell or any other tool that connects to
c34f3f
\fBmongos\fP or \fBmongod\fP is run without
c34f3f
\fI\-\-sslCAFile\fP, it will not attempt to validate
c34f3f
server certificates. This results in vulnerability to expired
c34f3f
\fBmongod\fP and \fBmongos\fP certificates as well as to foreign
c34f3f
processes posing as valid \fBmongod\fP or \fBmongos\fP
c34f3f
instances. Ensure that you \fIalways\fP specify the CA file against which
c34f3f
server certificates should be validated in cases where intrusion is a
c34f3f
possibility.
c34f3f
.UNINDENT
c34f3f
.UNINDENT
c34f3f
.UNINDENT
c34f3f
.INDENT 0.0
c34f3f
.TP
c34f3f
.B \-\-sslPEMKeyFile <filename>
c34f3f
New in version 2.6.
c34f3f
c34f3f
.sp
c34f3f
Specifies the \fB\&.pem\fP file that contains both the SSL certificate
c34f3f
and key. Specify the file name of the \fB\&.pem\fP file using relative
c34f3f
or absolute paths.
c34f3f
.sp
c34f3f
This option is required when using the \fI\-\-ssl\fP option to connect
c34f3f
to a \fBmongod\fP or \fBmongos\fP that has
c34f3f
\fBCAFile\fP enabled \fIwithout\fP
c34f3f
\fBallowConnectionsWithoutCertificates\fP\&.
c34f3f
.sp
c34f3f
The default distribution of MongoDB does not contain support for SSL.
c34f3f
For more information on MongoDB and SSL, see http://docs.mongodb.org/manual/tutorial/configure\-ssl\&.
c34f3f
.UNINDENT
c34f3f
.INDENT 0.0
c34f3f
.TP
c34f3f
.B \-\-sslPEMKeyPassword <value>
c34f3f
New in version 2.6.
c34f3f
c34f3f
.sp
c34f3f
Specifies the password to de\-crypt the certificate\-key file (i.e.
c34f3f
\fI\-\-sslPEMKeyFile\fP). Use the \fI\-\-sslPEMKeyPassword\fP option only if the
c34f3f
certificate\-key file is encrypted. In all cases, the \fBmongofiles\fP will
c34f3f
redact the password from all logging and reporting output.
c34f3f
.sp
c34f3f
If the private key in the PEM file is encrypted and you do not specify
c34f3f
the \fI\-\-sslPEMKeyPassword\fP option, the \fBmongofiles\fP will prompt for a passphrase. See
c34f3f
\fIssl\-certificate\-password\fP\&.
c34f3f
.sp
c34f3f
The default distribution of MongoDB does not contain support for SSL.
c34f3f
For more information on MongoDB and SSL, see http://docs.mongodb.org/manual/tutorial/configure\-ssl\&.
c34f3f
.UNINDENT
c34f3f
.INDENT 0.0
c34f3f
.TP
c34f3f
.B \-\-sslCRLFile <filename>
c34f3f
New in version 2.6.
c34f3f
c34f3f
.sp
c34f3f
Specifies the \fB\&.pem\fP file that contains the Certificate Revocation
c34f3f
List. Specify the file name of the \fB\&.pem\fP file using relative or
c34f3f
absolute paths.
c34f3f
.sp
c34f3f
The default distribution of MongoDB does not contain support for SSL.
c34f3f
For more information on MongoDB and SSL, see http://docs.mongodb.org/manual/tutorial/configure\-ssl\&.
c34f3f
.UNINDENT
c34f3f
.INDENT 0.0
c34f3f
.TP
c34f3f
.B \-\-sslAllowInvalidCertificates
c34f3f
New in version 2.6.
c34f3f
c34f3f
.sp
c34f3f
Bypasses the validation checks for server certificates and allows
c34f3f
the use of invalid certificates. When using the
c34f3f
\fBallowInvalidCertificates\fP setting, MongoDB logs as a
c34f3f
warning the use of the invalid certificate.
c34f3f
.sp
c34f3f
The default distribution of MongoDB does not contain support for SSL.
c34f3f
For more information on MongoDB and SSL, see http://docs.mongodb.org/manual/tutorial/configure\-ssl\&.
c34f3f
.UNINDENT
c34f3f
.INDENT 0.0
c34f3f
.TP
c34f3f
.B \-\-sslAllowInvalidHostnames
c34f3f
New in version 3.0.
c34f3f
c34f3f
.sp
c34f3f
Disables the validation of the hostnames in SSL certificates. Allows
c34f3f
\fBmongofiles\fP to connect to MongoDB instances if the hostname their
c34f3f
certificates do not match the specified hostname.
c34f3f
.UNINDENT
c34f3f
.INDENT 0.0
c34f3f
.TP
c34f3f
.B \-\-sslFIPSMode
c34f3f
New in version 2.6.
c34f3f
c34f3f
.sp
c34f3f
Directs the \fBmongofiles\fP to use the FIPS mode of the installed OpenSSL
c34f3f
library. Your system must have a FIPS compliant OpenSSL library to use
c34f3f
the \fI\-\-sslFIPSMode\fP option.
c34f3f
.sp
c34f3f
\fBNOTE:\fP
c34f3f
.INDENT 7.0
c34f3f
.INDENT 3.5
c34f3f
FIPS Compatible SSL is
c34f3f
available only in \fI\%MongoDB Enterprise\fP\&. See
c34f3f
http://docs.mongodb.org/manual/tutorial/configure\-fips for more information.
c34f3f
.UNINDENT
c34f3f
.UNINDENT
c34f3f
.UNINDENT
c34f3f
.INDENT 0.0
c34f3f
.TP
c34f3f
.B \-\-username <username>, \-u <username>
c34f3f
Specifies a username with which to authenticate to a MongoDB database
c34f3f
that uses authentication. Use in conjunction with the \fB\-\-password\fP and
c34f3f
\fB\-\-authenticationDatabase\fP options.
c34f3f
.UNINDENT
c34f3f
.INDENT 0.0
c34f3f
.TP
c34f3f
.B \-\-password <password>, \-p <password>
c34f3f
Specifies a password with which to authenticate to a MongoDB database
c34f3f
that uses authentication. Use in conjunction with the \fB\-\-username\fP and
c34f3f
\fB\-\-authenticationDatabase\fP options.
c34f3f
.sp
c34f3f
If you do not specify an argument for \fI\-\-password\fP, \fBmongofiles\fP will
c34f3f
prompt interactively for a password on the console.
c34f3f
.UNINDENT
c34f3f
.INDENT 0.0
c34f3f
.TP
c34f3f
.B \-\-authenticationDatabase <dbname>
c34f3f
New in version 2.4.
c34f3f
c34f3f
.sp
c34f3f
Specifies the database that holds the user\(aqs credentials.
c34f3f
.UNINDENT
c34f3f
.INDENT 0.0
c34f3f
.TP
c34f3f
.B \-\-authenticationMechanism <name>
c34f3f
\fIDefault\fP: MONGODB\-CR
c34f3f
.sp
c34f3f
New in version 2.4.
c34f3f
c34f3f
.sp
c34f3f
Changed in version 2.6: Added support for the \fBPLAIN\fP and \fBMONGODB\-X509\fP authentication
c34f3f
mechanisms.
c34f3f
c34f3f
.sp
c34f3f
Specifies the authentication mechanism the \fBmongofiles\fP instance uses to
c34f3f
authenticate to the \fBmongod\fP or \fBmongos\fP\&.
c34f3f
.TS
c34f3f
center;
c34f3f
|l|l|.
c34f3f
_
c34f3f
T{
c34f3f
Value
c34f3f
T}	T{
c34f3f
Description
c34f3f
T}
c34f3f
_
c34f3f
T{
c34f3f
MONGODB\-CR
c34f3f
T}	T{
c34f3f
MongoDB challenge/response authentication.
c34f3f
T}
c34f3f
_
c34f3f
T{
c34f3f
MONGODB\-X509
c34f3f
T}	T{
c34f3f
MongoDB SSL certificate authentication.
c34f3f
T}
c34f3f
_
c34f3f
T{
c34f3f
PLAIN
c34f3f
T}	T{
c34f3f
External authentication using LDAP. You can also use \fBPLAIN\fP
c34f3f
for authenticating in\-database users. \fBPLAIN\fP transmits
c34f3f
passwords in plain text. This mechanism is available only in
c34f3f
\fI\%MongoDB Enterprise\fP\&.
c34f3f
T}
c34f3f
_
c34f3f
T{
c34f3f
GSSAPI
c34f3f
T}	T{
c34f3f
External authentication using Kerberos. This mechanism is
c34f3f
available only in \fI\%MongoDB Enterprise\fP\&.
c34f3f
T}
c34f3f
_
c34f3f
.TE
c34f3f
.UNINDENT
c34f3f
.INDENT 0.0
c34f3f
.TP
c34f3f
.B \-\-gssapiServiceName
c34f3f
New in version 2.6.
c34f3f
c34f3f
.sp
c34f3f
Specify the name of the service using \fBGSSAPI/Kerberos\fP\&. Only required if the service does not use the
c34f3f
default name of \fBmongodb\fP\&.
c34f3f
.sp
c34f3f
This option is available only in MongoDB Enterprise.
c34f3f
.UNINDENT
c34f3f
.INDENT 0.0
c34f3f
.TP
c34f3f
.B \-\-gssapiHostName
c34f3f
New in version 2.6.
c34f3f
c34f3f
.sp
c34f3f
Specify the hostname of a service using \fBGSSAPI/Kerberos\fP\&. \fIOnly\fP required if the hostname of a machine does
c34f3f
not match the hostname resolved by DNS.
c34f3f
.sp
c34f3f
This option is available only in MongoDB Enterprise.
c34f3f
.UNINDENT
c34f3f
.INDENT 0.0
c34f3f
.TP
c34f3f
.B \-\-db <database>, \-d <database>
c34f3f
Specifies the name of the database on which to run the \fBmongofiles\fP\&.
c34f3f
.UNINDENT
c34f3f
.INDENT 0.0
c34f3f
.TP
c34f3f
.B \-\-collection <collection>, \-c <collection>
c34f3f
This option has no use in this context and a future release may
c34f3f
remove it. See \fI\%SERVER\-4931\fP for more information.
c34f3f
.UNINDENT
c34f3f
.INDENT 0.0
c34f3f
.TP
c34f3f
.B \-\-local <filename>, \-l <filename>
c34f3f
Specifies the local filesystem name of a file for get and put
c34f3f
operations.
c34f3f
.sp
c34f3f
In the \fBmongofiles put\fP and \fBmongofiles get\fP commands,
c34f3f
the required \fB<filename>\fP modifier refers to the name the object will
c34f3f
have in GridFS. \fBmongofiles\fP assumes that this reflects the
c34f3f
file\(aqs name on the local file system. This setting overrides this
c34f3f
default.
c34f3f
.UNINDENT
c34f3f
.INDENT 0.0
c34f3f
.TP
c34f3f
.B \-\-type <MIME>
c34f3f
Provides the ability to specify a \fIMIME\fP type to describe the file
c34f3f
inserted into GridFS storage. \fBmongofiles\fP omits this option in
c34f3f
the default operation.
c34f3f
.sp
c34f3f
Use only with \fBmongofiles put\fP operations.
c34f3f
.UNINDENT
c34f3f
.INDENT 0.0
c34f3f
.TP
c34f3f
.B \-\-replace, \-r
c34f3f
Alters the behavior of \fBmongofiles put\fP to replace existing
c34f3f
GridFS objects with the specified local file, rather than adding an
c34f3f
additional object with the same name.
c34f3f
.sp
c34f3f
In the default operation, files will not be overwritten by a
c34f3f
\fBmongofiles put\fP option.
c34f3f
.UNINDENT
c34f3f
.INDENT 0.0
c34f3f
.TP
c34f3f
.B \-\-prefix string
c34f3f
\fIDefault\fP: fs
c34f3f
.sp
c34f3f
GridFS prefix to use.
c34f3f
.UNINDENT
c34f3f
.INDENT 0.0
c34f3f
.TP
c34f3f
.B \-\-writeConcern <document>
c34f3f
\fIDefault\fP: majority
c34f3f
.sp
c34f3f
Specifies the \fIwrite concern\fP for each write operation that \fBmongofiles\fP
c34f3f
writes to the target database.
c34f3f
.sp
c34f3f
Specify the write concern as a document with \fIw options\fP\&.
c34f3f
.UNINDENT
c34f3f
.SH COMMANDS
c34f3f
.INDENT 0.0
c34f3f
.TP
c34f3f
.B list <prefix>
c34f3f
Lists the files in the GridFS store. The characters specified after
c34f3f
\fBlist\fP (e.g. \fB<prefix>\fP) optionally limit the list of
c34f3f
returned items to files that begin with that string of characters.
c34f3f
.UNINDENT
c34f3f
.INDENT 0.0
c34f3f
.TP
c34f3f
.B search <string>
c34f3f
Lists the files in the GridFS store with names that match any
c34f3f
portion of \fB<string>\fP\&.
c34f3f
.UNINDENT
c34f3f
.INDENT 0.0
c34f3f
.TP
c34f3f
.B put <filename>
c34f3f
Copy the specified file from the local file system into GridFS
c34f3f
storage.
c34f3f
.sp
c34f3f
Here, \fB<filename>\fP refers to the name the object will have in
c34f3f
GridFS, and \fBmongofiles\fP assumes that this reflects the name the
c34f3f
file has on the local file system. If the local filename is
c34f3f
different use the \fImongofiles \-\-local\fP option.
c34f3f
.UNINDENT
c34f3f
.INDENT 0.0
c34f3f
.TP
c34f3f
.B get <filename>
c34f3f
Copy the specified file from GridFS storage to the local file
c34f3f
system.
c34f3f
.sp
c34f3f
Here, \fB<filename>\fP refers to the name the object will have in
c34f3f
GridFS, and \fBmongofiles\fP assumes that this reflects the name the
c34f3f
file has on the local file system. If the local filename is
c34f3f
different use the \fImongofiles \-\-local\fP option.
c34f3f
.UNINDENT
c34f3f
.INDENT 0.0
c34f3f
.TP
c34f3f
.B delete <filename>
c34f3f
Delete the specified file from GridFS storage.
c34f3f
.UNINDENT
c34f3f
.SH EXAMPLES
c34f3f
.sp
c34f3f
To return a list of all files in a \fIGridFS\fP collection in the
c34f3f
\fBrecords\fP database, use the following invocation at the system shell:
c34f3f
.INDENT 0.0
c34f3f
.INDENT 3.5
c34f3f
.sp
c34f3f
.nf
c34f3f
.ft C
c34f3f
mongofiles \-d records list
c34f3f
.ft P
c34f3f
.fi
c34f3f
.UNINDENT
c34f3f
.UNINDENT
c34f3f
.sp
c34f3f
This \fBmongofiles\fP instance will connect to the
c34f3f
\fBmongod\fP instance running on the \fB27017\fP localhost
c34f3f
interface to specify the same operation on a different port or
c34f3f
hostname, and issue a command that resembles one of the following:
c34f3f
.INDENT 0.0
c34f3f
.INDENT 3.5
c34f3f
.sp
c34f3f
.nf
c34f3f
.ft C
c34f3f
mongofiles \-\-port 37017 \-d records list
c34f3f
mongofiles \-\-hostname db1.example.net \-d records list
c34f3f
mongofiles \-\-hostname db1.example.net \-\-port 37017 \-d records list
c34f3f
.ft P
c34f3f
.fi
c34f3f
.UNINDENT
c34f3f
.UNINDENT
c34f3f
.sp
c34f3f
Modify any of the following commands as needed if you\(aqre connecting
c34f3f
the \fBmongod\fP instances on different ports or hosts.
c34f3f
.sp
c34f3f
To upload a file named \fB32\-corinth.lp\fP to the GridFS collection in
c34f3f
the \fBrecords\fP database, you can use the following command:
c34f3f
.INDENT 0.0
c34f3f
.INDENT 3.5
c34f3f
.sp
c34f3f
.nf
c34f3f
.ft C
c34f3f
mongofiles \-d records put 32\-corinth.lp
c34f3f
.ft P
c34f3f
.fi
c34f3f
.UNINDENT
c34f3f
.UNINDENT
c34f3f
.sp
c34f3f
To delete the \fB32\-corinth.lp\fP file from this GridFS collection in
c34f3f
the \fBrecords\fP database, you can use the following command:
c34f3f
.INDENT 0.0
c34f3f
.INDENT 3.5
c34f3f
.sp
c34f3f
.nf
c34f3f
.ft C
c34f3f
mongofiles \-d records delete 32\-corinth.lp
c34f3f
.ft P
c34f3f
.fi
c34f3f
.UNINDENT
c34f3f
.UNINDENT
c34f3f
.sp
c34f3f
To search for files in the GridFS collection in the \fBrecords\fP
c34f3f
database that have the string \fBcorinth\fP in their names, you can use
c34f3f
following command:
c34f3f
.INDENT 0.0
c34f3f
.INDENT 3.5
c34f3f
.sp
c34f3f
.nf
c34f3f
.ft C
c34f3f
mongofiles \-d records search corinth
c34f3f
.ft P
c34f3f
.fi
c34f3f
.UNINDENT
c34f3f
.UNINDENT
c34f3f
.sp
c34f3f
To list all files in the GridFS collection in the \fBrecords\fP database
c34f3f
that begin with the string \fB32\fP, you can use the following command:
c34f3f
.INDENT 0.0
c34f3f
.INDENT 3.5
c34f3f
.sp
c34f3f
.nf
c34f3f
.ft C
c34f3f
mongofiles \-d records list 32
c34f3f
.ft P
c34f3f
.fi
c34f3f
.UNINDENT
c34f3f
.UNINDENT
c34f3f
.sp
c34f3f
To fetch the file from the GridFS collection in the \fBrecords\fP
c34f3f
database named \fB32\-corinth.lp\fP, you can use the following command:
c34f3f
.INDENT 0.0
c34f3f
.INDENT 3.5
c34f3f
.sp
c34f3f
.nf
c34f3f
.ft C
c34f3f
mongofiles \-d records get 32\-corinth.lp
c34f3f
.ft P
c34f3f
.fi
c34f3f
.UNINDENT
c34f3f
.UNINDENT
c34f3f
.SH AUTHOR
c34f3f
MongoDB Documentation Project
c34f3f
.SH COPYRIGHT
c34f3f
2011-2015
c34f3f
.\" Generated by docutils manpage writer.
c34f3f
.