Table of Contents

Method FindOne

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

FindOne(IMongoQuery)

Finds the most recent version of a GridFS file.

public MongoGridFSFileInfo FindOne(IMongoQuery query)

Parameters

query IMongoQuery

The GridFS file.

Returns

MongoGridFSFileInfo

The matching GridFS file.

FindOne(IMongoQuery, int)

Finds a specific version of a GridFS file.

public MongoGridFSFileInfo FindOne(IMongoQuery query, int version)

Parameters

query IMongoQuery

The GridFS file.

version int

The version to find (1 is oldest, -1 is newest, 0 is no sort).

Returns

MongoGridFSFileInfo

The matching GridFS file.

FindOne(string)

Finds the most recent version of a GridFS file.

public MongoGridFSFileInfo FindOne(string remoteFileName)

Parameters

remoteFileName string

The remote file name.

Returns

MongoGridFSFileInfo

The matching GridFS file.

FindOne(string, int)

Finds a specific version of a GridFS file.

public MongoGridFSFileInfo FindOne(string remoteFileName, int version)

Parameters

remoteFileName string

The remote file name.

version int

The version to find.

Returns

MongoGridFSFileInfo

The matching GridFS file.