/// <summary> /// Finds matching GridFS files. /// </summary> /// <param name="query">A query.</param> /// <returns>The matching GridFS files.</returns> public MongoCursor <MongoGridFSFileInfo> Find(IMongoQuery query) { var serializationOptions = new MongoGridFSFileInfo.SerializationOptions { GridFS = this }; return(_files.FindAs <MongoGridFSFileInfo>(query).SetSerializationOptions(serializationOptions)); }
/// <summary> /// Finds matching GridFS files. /// </summary> /// <param name="query">A query.</param> /// <returns>The matching GridFS files.</returns> public MongoCursor <MongoGridFSFileInfo> Find(IMongoQuery query) { using (_server.RequestStart(null, _settings.ReadPreference)) { var serverInstance = _server.RequestConnection.ServerInstance; var database = GetDatabase(); var filesCollection = GetFilesCollection(database); var serializationOptions = new MongoGridFSFileInfo.SerializationOptions { Server = _server, ServerInstance = serverInstance, DatabaseName = _databaseName, GridFSSettings = _settings }; return(filesCollection.FindAs <MongoGridFSFileInfo>(query).SetSerializationOptions(serializationOptions)); } }
/// <summary> /// Finds matching GridFS files. /// </summary> /// <param name="query">A query.</param> /// <returns>The matching GridFS files.</returns> public MongoCursor<MongoGridFSFileInfo> Find( IMongoQuery query ) { var serializationOptions = new MongoGridFSFileInfo.SerializationOptions { GridFS = this }; return files.FindAs<MongoGridFSFileInfo>(query).SetSerializationOptions(serializationOptions); }
/// <summary> /// Finds matching GridFS files. /// </summary> /// <param name="query">A query.</param> /// <returns>The matching GridFS files.</returns> public MongoCursor<MongoGridFSFileInfo> Find(IMongoQuery query) { using (_server.RequestStart(null, _settings.ReadPreference)) { var serverInstance = _server.RequestConnection.ServerInstance; var database = GetDatabase(); var filesCollection = GetFilesCollection(database); var serializationOptions = new MongoGridFSFileInfo.SerializationOptions { Server = _server, ServerInstance = serverInstance, DatabaseName = _databaseName, GridFSSettings = _settings }; return filesCollection.FindAs<MongoGridFSFileInfo>(query).SetSerializationOptions(serializationOptions); } }