Table of Contents

Class GridFSBucket<TFileId>

Namespace
MongoDB.Driver.GridFS
Assembly
MongoDB.Driver.GridFS.dll

Represents a GridFS bucket.

public class GridFSBucket<TFileId> : IGridFSBucket<TFileId>

Type Parameters

TFileId

The type of the file identifier.

Inheritance
GridFSBucket<TFileId>
Implements
IGridFSBucket<TFileId>
Derived
Inherited Members

Constructors

GridFSBucket(IMongoDatabase, GridFSBucketOptions)

Initializes a new instance of the GridFSBucket class.

Properties

Database

Gets the database where the GridFS files are stored.

Options

Gets the options.

Methods

Delete(TFileId, CancellationToken)

Deletes a file from GridFS.

DeleteAsync(TFileId, CancellationToken)

Deletes a file from GridFS.

DownloadAsBytes(TFileId, GridFSDownloadOptions, CancellationToken)

Downloads a file stored in GridFS and returns it as a byte array.

DownloadAsBytesAsync(TFileId, GridFSDownloadOptions, CancellationToken)

Downloads a file stored in GridFS and returns it as a byte array.

DownloadAsBytesByName(string, GridFSDownloadByNameOptions, CancellationToken)

Downloads a file stored in GridFS and returns it as a byte array.

DownloadAsBytesByNameAsync(string, GridFSDownloadByNameOptions, CancellationToken)

Downloads a file stored in GridFS and returns it as a byte array.

DownloadToStream(TFileId, Stream, GridFSDownloadOptions, CancellationToken)

Downloads a file stored in GridFS and writes the contents to a stream.

DownloadToStreamAsync(TFileId, Stream, GridFSDownloadOptions, CancellationToken)

Downloads a file stored in GridFS and writes the contents to a stream.

DownloadToStreamByName(string, Stream, GridFSDownloadByNameOptions, CancellationToken)

Downloads a file stored in GridFS and writes the contents to a stream.

DownloadToStreamByNameAsync(string, Stream, GridFSDownloadByNameOptions, CancellationToken)

Downloads a file stored in GridFS and writes the contents to a stream.

Drop(CancellationToken)

Drops the files and chunks collections associated with this GridFS bucket.

DropAsync(CancellationToken)

Drops the files and chunks collections associated with this GridFS bucket.

Find(FilterDefinition<GridFSFileInfo<TFileId>>, GridFSFindOptions<TFileId>, CancellationToken)

Finds matching entries from the files collection.

FindAsync(FilterDefinition<GridFSFileInfo<TFileId>>, GridFSFindOptions<TFileId>, CancellationToken)

Finds matching entries from the files collection.

OpenDownloadStream(TFileId, GridFSDownloadOptions, CancellationToken)

Opens a Stream that can be used by the application to read data from a GridFS file.

OpenDownloadStreamAsync(TFileId, GridFSDownloadOptions, CancellationToken)

Opens a Stream that can be used by the application to read data from a GridFS file.

OpenDownloadStreamByName(string, GridFSDownloadByNameOptions, CancellationToken)

Opens a Stream that can be used by the application to read data from a GridFS file.

OpenDownloadStreamByNameAsync(string, GridFSDownloadByNameOptions, CancellationToken)

Opens a Stream that can be used by the application to read data from a GridFS file.

OpenUploadStream(TFileId, string, GridFSUploadOptions, CancellationToken)

Opens a Stream that can be used by the application to write data to a GridFS file.

OpenUploadStreamAsync(TFileId, string, GridFSUploadOptions, CancellationToken)

Opens a Stream that can be used by the application to write data to a GridFS file.

Rename(TFileId, string, CancellationToken)

Renames a GridFS file.

RenameAsync(TFileId, string, CancellationToken)

Renames a GridFS file.

UploadFromBytes(TFileId, string, byte[], GridFSUploadOptions, CancellationToken)

Uploads a file (or a new revision of a file) to GridFS.

UploadFromBytesAsync(TFileId, string, byte[], GridFSUploadOptions, CancellationToken)

Uploads a file (or a new revision of a file) to GridFS.

UploadFromStream(TFileId, string, Stream, GridFSUploadOptions, CancellationToken)

Uploads a file (or a new revision of a file) to GridFS.

UploadFromStreamAsync(TFileId, string, Stream, GridFSUploadOptions, CancellationToken)

Uploads a file (or a new revision of a file) to GridFS.