C# Class MongoDB.Driver.GridFS.MongoGridFS

Represents a GridFS file system.
Afficher le fichier Open project: Qiredev/mongo-csharp-driver Class Usage Examples

Méthodes publiques

Méthode Description
AppendText ( string remoteFileName ) : StreamWriter

Appends UTF-8 encoded text to an existing GridFS file.

CopyTo ( string sourceFileName, string destFileName ) : MongoDB.Driver.GridFS.MongoGridFSFileInfo

Copies a GridFS file.

CopyTo ( string sourceFileName, string destFileName, MongoGridFSCreateOptions createOptions ) : MongoDB.Driver.GridFS.MongoGridFSFileInfo

Copies a GridFS file.

Create ( string remoteFileName ) : MongoGridFSStream

Creates or overwrites a GridFS file.

Create ( string remoteFileName, MongoGridFSCreateOptions createOptions ) : MongoGridFSStream

Creates or overwrites a GridFS file.

CreateText ( string remoteFileName ) : StreamWriter

Creates or opens a GridFS file for writing UTF-8 encoded text.

CreateText ( string remoteFileName, MongoGridFSCreateOptions createOptions ) : StreamWriter

Creates or opens a GridFS file for writing UTF-8 encoded text.

Delete ( IMongoQuery query ) : void

Deletes GridFS files.

Delete ( string remoteFileName ) : void

Deletes all versions of a GridFS file.

DeleteById ( BsonValue id ) : void

Deletes a GridFS file.

Download ( Stream stream, IMongoQuery query ) : void

Downloads the most recent version of a GridFS file.

Download ( Stream stream, IMongoQuery query, int version ) : void

Downloads a specific version of a GridFS file.

Download ( Stream stream, MongoDB.Driver.GridFS.MongoGridFSFileInfo fileInfo ) : void

Downloads a GridFS file.

Download ( Stream stream, string remoteFileName ) : void

Downloads the most recent version of a GridFS file.

Download ( Stream stream, string remoteFileName, int version ) : void

Downloads a specific version of a GridFS file.

Download ( string fileName ) : void

Downloads the most recent version of a GridFS file.

Download ( string localFileName, IMongoQuery query ) : void

Downloads the most recent version of a GridFS file.

Download ( string localFileName, IMongoQuery query, int version ) : void

Downloads a specific version of a GridFS file.

Download ( string localFileName, MongoDB.Driver.GridFS.MongoGridFSFileInfo fileInfo ) : void

Downloads a GridFS file.

Download ( string fileName, int version ) : void

Downloads a specific version of a GridFS file.

Download ( string localFileName, string remoteFileName ) : void

Downloads the most recent version of a GridFS file.

Download ( string localFileName, string remoteFileName, int version ) : void

Downloads a specific version of a GridFS file.

EnsureIndexes ( ) : void

Ensures that the proper indexes for GridFS exist (only creates the new indexes if there are fewer than 1000 GridFS files).

EnsureIndexes ( int maxFiles ) : void

Ensures that the proper indexes for GridFS exist.

Exists ( IMongoQuery query ) : bool

Tests whether a GridFS file exists.

Exists ( string remoteFileName ) : bool

Tests whether a GridFS file exists.

ExistsById ( BsonValue id ) : bool

Tests whether a GridFS file exists.

Find ( IMongoQuery query ) : MongoCursor

Finds matching GridFS files.

Find ( string remoteFileName ) : MongoCursor

Finds matching GridFS files.

FindAll ( ) : MongoCursor

Finds all GridFS files.

FindOne ( IMongoQuery query ) : MongoDB.Driver.GridFS.MongoGridFSFileInfo

Finds the most recent version of a GridFS file.

FindOne ( IMongoQuery query, int version ) : MongoDB.Driver.GridFS.MongoGridFSFileInfo

Finds a specific version of a GridFS file.

FindOne ( string remoteFileName ) : MongoDB.Driver.GridFS.MongoGridFSFileInfo

Finds the most recent version of a GridFS file.

FindOne ( string remoteFileName, int version ) : MongoDB.Driver.GridFS.MongoGridFSFileInfo

Finds a specific version of a GridFS file.

FindOneById ( BsonValue id ) : MongoDB.Driver.GridFS.MongoGridFSFileInfo

Finds a GridFS file.

MongoGridFS ( MongoDatabase database ) : System

Initializes a new instance of the MongoGridFS class.

MongoGridFS ( MongoDatabase database, MongoDB.Driver.GridFS.MongoGridFSSettings settings ) : System

Initializes a new instance of the MongoGridFS class.

MoveTo ( string sourceFileName, string destFileName ) : void

Moves the most recent version of a GridFS file.

Open ( string remoteFileName, FileMode mode ) : MongoGridFSStream

Opens a GridFS file with the specified mode.

Open ( string remoteFileName, FileMode mode, FileAccess access ) : MongoGridFSStream

Opens a GridFS file with the specified mode and access.

Open ( string remoteFileName, FileMode mode, FileAccess access, MongoGridFSCreateOptions createOptions ) : MongoGridFSStream

Opens a GridFS file with the specified mode, access and create options.

OpenRead ( string remoteFileName ) : MongoGridFSStream

Opens an existing GridFS file for reading.

OpenText ( string remoteFileName ) : StreamReader

Opens an existing UTF-8 encoded text GridFS file for reading.

OpenWrite ( string remoteFileName ) : MongoGridFSStream

Opens an existing GridFS file for writing.

OpenWrite ( string remoteFileName, MongoGridFSCreateOptions createOptions ) : MongoGridFSStream

Opens an existing GridFS file for writing.

SetAliases ( MongoDB.Driver.GridFS.MongoGridFSFileInfo fileInfo, string aliases ) : void

Sets the aliases for an existing GridFS file.

SetContentType ( MongoDB.Driver.GridFS.MongoGridFSFileInfo fileInfo, string contentType ) : void

Sets the content type for an existing GridFS file.

SetMetadata ( MongoDB.Driver.GridFS.MongoGridFSFileInfo fileInfo, BsonValue metadata ) : void

Sets the metadata for an existing GridFS file.

Upload ( Stream stream, string remoteFileName ) : MongoDB.Driver.GridFS.MongoGridFSFileInfo

Uploads a GridFS file.

Upload ( Stream stream, string remoteFileName, MongoGridFSCreateOptions createOptions ) : MongoDB.Driver.GridFS.MongoGridFSFileInfo

Uploads a GridFS file.

Upload ( string fileName ) : MongoDB.Driver.GridFS.MongoGridFSFileInfo

Uploads a GridFS file.

Upload ( string localFileName, string remoteFileName ) : MongoDB.Driver.GridFS.MongoGridFSFileInfo

Uploads a GridFS file.

Method Details

AppendText() public méthode

Appends UTF-8 encoded text to an existing GridFS file.
public AppendText ( string remoteFileName ) : StreamWriter
remoteFileName string The remote file name.
Résultat System.IO.StreamWriter

CopyTo() public méthode

Copies a GridFS file.
public CopyTo ( string sourceFileName, string destFileName ) : MongoDB.Driver.GridFS.MongoGridFSFileInfo
sourceFileName string The source file name.
destFileName string The destination file name.
Résultat MongoDB.Driver.GridFS.MongoGridFSFileInfo

CopyTo() public méthode

Copies a GridFS file.
public CopyTo ( string sourceFileName, string destFileName, MongoGridFSCreateOptions createOptions ) : MongoDB.Driver.GridFS.MongoGridFSFileInfo
sourceFileName string The source file name.
destFileName string The destination file name.
createOptions MongoGridFSCreateOptions The create options.
Résultat MongoDB.Driver.GridFS.MongoGridFSFileInfo

Create() public méthode

Creates or overwrites a GridFS file.
public Create ( string remoteFileName ) : MongoGridFSStream
remoteFileName string The remote file name.
Résultat MongoGridFSStream

Create() public méthode

Creates or overwrites a GridFS file.
public Create ( string remoteFileName, MongoGridFSCreateOptions createOptions ) : MongoGridFSStream
remoteFileName string The remote file name.
createOptions MongoGridFSCreateOptions The create options.
Résultat MongoGridFSStream

CreateText() public méthode

Creates or opens a GridFS file for writing UTF-8 encoded text.
public CreateText ( string remoteFileName ) : StreamWriter
remoteFileName string The remote file name.
Résultat System.IO.StreamWriter

CreateText() public méthode

Creates or opens a GridFS file for writing UTF-8 encoded text.
public CreateText ( string remoteFileName, MongoGridFSCreateOptions createOptions ) : StreamWriter
remoteFileName string The remote file name.
createOptions MongoGridFSCreateOptions The create options.
Résultat System.IO.StreamWriter

Delete() public méthode

Deletes GridFS files.
public Delete ( IMongoQuery query ) : void
query IMongoQuery A query that specifies the GridFS files to delete.
Résultat void

Delete() public méthode

Deletes all versions of a GridFS file.
public Delete ( string remoteFileName ) : void
remoteFileName string The remote file name.
Résultat void

DeleteById() public méthode

Deletes a GridFS file.
public DeleteById ( BsonValue id ) : void
id BsonValue The GridFS file Id.
Résultat void

Download() public méthode

Downloads the most recent version of a GridFS file.
public Download ( Stream stream, IMongoQuery query ) : void
stream Stream The destination stream.
query IMongoQuery The GridFS file.
Résultat void

Download() public méthode

Downloads a specific version of a GridFS file.
public Download ( Stream stream, IMongoQuery query, int version ) : void
stream Stream The destination stream.
query IMongoQuery The GridFS file.
version int The version to download.
Résultat void

Download() public méthode

Downloads a GridFS file.
public Download ( Stream stream, MongoDB.Driver.GridFS.MongoGridFSFileInfo fileInfo ) : void
stream Stream The destination stream.
fileInfo MongoDB.Driver.GridFS.MongoGridFSFileInfo The GridFS file.
Résultat void

Download() public méthode

Downloads the most recent version of a GridFS file.
public Download ( Stream stream, string remoteFileName ) : void
stream Stream The destination stream.
remoteFileName string The remote file name.
Résultat void

Download() public méthode

Downloads a specific version of a GridFS file.
public Download ( Stream stream, string remoteFileName, int version ) : void
stream Stream The destination stream.
remoteFileName string The remote file name.
version int The version to download.
Résultat void

Download() public méthode

Downloads the most recent version of a GridFS file.
public Download ( string fileName ) : void
fileName string The file name (same local and remote names).
Résultat void

Download() public méthode

Downloads the most recent version of a GridFS file.
public Download ( string localFileName, IMongoQuery query ) : void
localFileName string The local file name.
query IMongoQuery The GridFS file.
Résultat void

Download() public méthode

Downloads a specific version of a GridFS file.
public Download ( string localFileName, IMongoQuery query, int version ) : void
localFileName string The local file name.
query IMongoQuery The GridFS file.
version int The version to download.
Résultat void

Download() public méthode

Downloads a GridFS file.
public Download ( string localFileName, MongoDB.Driver.GridFS.MongoGridFSFileInfo fileInfo ) : void
localFileName string The local file name.
fileInfo MongoDB.Driver.GridFS.MongoGridFSFileInfo The GridFS file.
Résultat void

Download() public méthode

Downloads a specific version of a GridFS file.
public Download ( string fileName, int version ) : void
fileName string The file name (same local and remote names).
version int The version to download.
Résultat void

Download() public méthode

Downloads the most recent version of a GridFS file.
public Download ( string localFileName, string remoteFileName ) : void
localFileName string The local file name.
remoteFileName string The remote file name.
Résultat void

Download() public méthode

Downloads a specific version of a GridFS file.
public Download ( string localFileName, string remoteFileName, int version ) : void
localFileName string The local file name.
remoteFileName string The remote file name.
version int The version to download.
Résultat void

EnsureIndexes() public méthode

Ensures that the proper indexes for GridFS exist (only creates the new indexes if there are fewer than 1000 GridFS files).
public EnsureIndexes ( ) : void
Résultat void

EnsureIndexes() public méthode

Ensures that the proper indexes for GridFS exist.
public EnsureIndexes ( int maxFiles ) : void
maxFiles int Only create new indexes if there are fewer than this number of GridFS files).
Résultat void

Exists() public méthode

Tests whether a GridFS file exists.
public Exists ( IMongoQuery query ) : bool
query IMongoQuery The GridFS file.
Résultat bool

Exists() public méthode

Tests whether a GridFS file exists.
public Exists ( string remoteFileName ) : bool
remoteFileName string The GridFS file.
Résultat bool

ExistsById() public méthode

Tests whether a GridFS file exists.
public ExistsById ( BsonValue id ) : bool
id BsonValue The GridFS file.
Résultat bool

Find() public méthode

Finds matching GridFS files.
public Find ( IMongoQuery query ) : MongoCursor
query IMongoQuery A query.
Résultat MongoCursor

Find() public méthode

Finds matching GridFS files.
public Find ( string remoteFileName ) : MongoCursor
remoteFileName string The remote file name.
Résultat MongoCursor

FindAll() public méthode

Finds all GridFS files.
public FindAll ( ) : MongoCursor
Résultat MongoCursor

FindOne() public méthode

Finds the most recent version of a GridFS file.
public FindOne ( IMongoQuery query ) : MongoDB.Driver.GridFS.MongoGridFSFileInfo
query IMongoQuery The GridFS file.
Résultat MongoDB.Driver.GridFS.MongoGridFSFileInfo

FindOne() public méthode

Finds a specific version of a GridFS file.
public FindOne ( IMongoQuery query, int version ) : MongoDB.Driver.GridFS.MongoGridFSFileInfo
query IMongoQuery The GridFS file.
version int The version to find.
Résultat MongoDB.Driver.GridFS.MongoGridFSFileInfo

FindOne() public méthode

Finds the most recent version of a GridFS file.
public FindOne ( string remoteFileName ) : MongoDB.Driver.GridFS.MongoGridFSFileInfo
remoteFileName string The remote file name.
Résultat MongoDB.Driver.GridFS.MongoGridFSFileInfo

FindOne() public méthode

Finds a specific version of a GridFS file.
public FindOne ( string remoteFileName, int version ) : MongoDB.Driver.GridFS.MongoGridFSFileInfo
remoteFileName string The remote file name.
version int The version to find.
Résultat MongoDB.Driver.GridFS.MongoGridFSFileInfo

FindOneById() public méthode

Finds a GridFS file.
public FindOneById ( BsonValue id ) : MongoDB.Driver.GridFS.MongoGridFSFileInfo
id BsonValue The GridFS file Id.
Résultat MongoDB.Driver.GridFS.MongoGridFSFileInfo

MongoGridFS() public méthode

Initializes a new instance of the MongoGridFS class.
public MongoGridFS ( MongoDatabase database ) : System
database MongoDatabase The database containing the GridFS collections.
Résultat System

MongoGridFS() public méthode

Initializes a new instance of the MongoGridFS class.
public MongoGridFS ( MongoDatabase database, MongoDB.Driver.GridFS.MongoGridFSSettings settings ) : System
database MongoDatabase The database containing the GridFS collections.
settings MongoDB.Driver.GridFS.MongoGridFSSettings The GridFS settings.
Résultat System

MoveTo() public méthode

Moves the most recent version of a GridFS file.
public MoveTo ( string sourceFileName, string destFileName ) : void
sourceFileName string The source file name.
destFileName string The destination file name.
Résultat void

Open() public méthode

Opens a GridFS file with the specified mode.
public Open ( string remoteFileName, FileMode mode ) : MongoGridFSStream
remoteFileName string The remote file name.
mode FileMode The mode.
Résultat MongoGridFSStream

Open() public méthode

Opens a GridFS file with the specified mode and access.
public Open ( string remoteFileName, FileMode mode, FileAccess access ) : MongoGridFSStream
remoteFileName string The remote file name.
mode FileMode The mode.
access FileAccess The access.
Résultat MongoGridFSStream

Open() public méthode

Opens a GridFS file with the specified mode, access and create options.
public Open ( string remoteFileName, FileMode mode, FileAccess access, MongoGridFSCreateOptions createOptions ) : MongoGridFSStream
remoteFileName string The remote file name.
mode FileMode The mode.
access FileAccess The access.
createOptions MongoGridFSCreateOptions The create options.
Résultat MongoGridFSStream

OpenRead() public méthode

Opens an existing GridFS file for reading.
public OpenRead ( string remoteFileName ) : MongoGridFSStream
remoteFileName string The remote file name.
Résultat MongoGridFSStream

OpenText() public méthode

Opens an existing UTF-8 encoded text GridFS file for reading.
public OpenText ( string remoteFileName ) : StreamReader
remoteFileName string The remote file name.
Résultat System.IO.StreamReader

OpenWrite() public méthode

Opens an existing GridFS file for writing.
public OpenWrite ( string remoteFileName ) : MongoGridFSStream
remoteFileName string The remote file name.
Résultat MongoGridFSStream

OpenWrite() public méthode

Opens an existing GridFS file for writing.
public OpenWrite ( string remoteFileName, MongoGridFSCreateOptions createOptions ) : MongoGridFSStream
remoteFileName string The remote file name.
createOptions MongoGridFSCreateOptions The create options.
Résultat MongoGridFSStream

SetAliases() public méthode

Sets the aliases for an existing GridFS file.
public SetAliases ( MongoDB.Driver.GridFS.MongoGridFSFileInfo fileInfo, string aliases ) : void
fileInfo MongoDB.Driver.GridFS.MongoGridFSFileInfo The GridFS file.
aliases string The aliases.
Résultat void

SetContentType() public méthode

Sets the content type for an existing GridFS file.
public SetContentType ( MongoDB.Driver.GridFS.MongoGridFSFileInfo fileInfo, string contentType ) : void
fileInfo MongoDB.Driver.GridFS.MongoGridFSFileInfo The GridFS file.
contentType string The content type.
Résultat void

SetMetadata() public méthode

Sets the metadata for an existing GridFS file.
public SetMetadata ( MongoDB.Driver.GridFS.MongoGridFSFileInfo fileInfo, BsonValue metadata ) : void
fileInfo MongoDB.Driver.GridFS.MongoGridFSFileInfo The GridFS file.
metadata BsonValue The metadata.
Résultat void

Upload() public méthode

Uploads a GridFS file.
public Upload ( Stream stream, string remoteFileName ) : MongoDB.Driver.GridFS.MongoGridFSFileInfo
stream Stream The source stream.
remoteFileName string The remote file name.
Résultat MongoDB.Driver.GridFS.MongoGridFSFileInfo

Upload() public méthode

Uploads a GridFS file.
public Upload ( Stream stream, string remoteFileName, MongoGridFSCreateOptions createOptions ) : MongoDB.Driver.GridFS.MongoGridFSFileInfo
stream Stream The source stream.
remoteFileName string The remote file name.
createOptions MongoGridFSCreateOptions The create options.
Résultat MongoDB.Driver.GridFS.MongoGridFSFileInfo

Upload() public méthode

Uploads a GridFS file.
public Upload ( string fileName ) : MongoDB.Driver.GridFS.MongoGridFSFileInfo
fileName string The file name (same local and remote names).
Résultat MongoDB.Driver.GridFS.MongoGridFSFileInfo

Upload() public méthode

Uploads a GridFS file.
public Upload ( string localFileName, string remoteFileName ) : MongoDB.Driver.GridFS.MongoGridFSFileInfo
localFileName string The local file name.
remoteFileName string The remote file name.
Résultat MongoDB.Driver.GridFS.MongoGridFSFileInfo