Table of Contents

Interface IGridFSBucket

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

Represents a GridFS system bucket.

public interface IGridFSBucket : IGridFSBucket<ObjectId>
Inherited Members

Methods

Find(FilterDefinition<GridFSFileInfo>, GridFSFindOptions, CancellationToken)

Finds matching entries from the files collection.

IAsyncCursor<GridFSFileInfo> Find(FilterDefinition<GridFSFileInfo> filter, GridFSFindOptions options = null, CancellationToken cancellationToken = default)

Parameters

filter FilterDefinition<GridFSFileInfo>

The filter.

options GridFSFindOptions

The options.

cancellationToken CancellationToken

The cancellation token.

Returns

IAsyncCursor<GridFSFileInfo>

A cursor of files collection documents.

FindAsync(FilterDefinition<GridFSFileInfo>, GridFSFindOptions, CancellationToken)

Finds matching entries from the files collection.

Task<IAsyncCursor<GridFSFileInfo>> FindAsync(FilterDefinition<GridFSFileInfo> filter, GridFSFindOptions options = null, CancellationToken cancellationToken = default)

Parameters

filter FilterDefinition<GridFSFileInfo>

The filter.

options GridFSFindOptions

The options.

cancellationToken CancellationToken

The cancellation token.

Returns

Task<IAsyncCursor<GridFSFileInfo>>

A Task whose result is a cursor of files collection documents.

OpenUploadStream(string, GridFSUploadOptions, CancellationToken)

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

GridFSUploadStream OpenUploadStream(string filename, GridFSUploadOptions options = null, CancellationToken cancellationToken = default)

Parameters

filename string

The filename.

options GridFSUploadOptions

The options.

cancellationToken CancellationToken

The cancellation token.

Returns

GridFSUploadStream

A Stream.

OpenUploadStreamAsync(string, GridFSUploadOptions, CancellationToken)

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

Task<GridFSUploadStream> OpenUploadStreamAsync(string filename, GridFSUploadOptions options = null, CancellationToken cancellationToken = default)

Parameters

filename string

The filename.

options GridFSUploadOptions

The options.

cancellationToken CancellationToken

The cancellation token.

Returns

Task<GridFSUploadStream>

A Task whose result is a Stream.

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

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

ObjectId UploadFromBytes(string filename, byte[] source, GridFSUploadOptions options = null, CancellationToken cancellationToken = default)

Parameters

filename string

The filename.

source byte[]

The source.

options GridFSUploadOptions

The options.

cancellationToken CancellationToken

The cancellation token.

Returns

ObjectId

The id of the new file.

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

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

Task<ObjectId> UploadFromBytesAsync(string filename, byte[] source, GridFSUploadOptions options = null, CancellationToken cancellationToken = default)

Parameters

filename string

The filename.

source byte[]

The source.

options GridFSUploadOptions

The options.

cancellationToken CancellationToken

The cancellation token.

Returns

Task<ObjectId>

A Task whose result is the id of the new file.

UploadFromStream(string, Stream, GridFSUploadOptions, CancellationToken)

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

ObjectId UploadFromStream(string filename, Stream source, GridFSUploadOptions options = null, CancellationToken cancellationToken = default)

Parameters

filename string

The filename.

source Stream

The source.

options GridFSUploadOptions

The options.

cancellationToken CancellationToken

The cancellation token.

Returns

ObjectId

The id of the new file.

UploadFromStreamAsync(string, Stream, GridFSUploadOptions, CancellationToken)

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

Task<ObjectId> UploadFromStreamAsync(string filename, Stream source, GridFSUploadOptions options = null, CancellationToken cancellationToken = default)

Parameters

filename string

The filename.

source Stream

The source.

options GridFSUploadOptions

The options.

cancellationToken CancellationToken

The cancellation token.

Returns

Task<ObjectId>

A Task whose result is the id of the new file.