mongoDB-2.2.0: Driver (client) for MongoDB, a free, scalable, fast, document DBMS

Safe HaskellNone
LanguageHaskell2010

Database.MongoDB.GridFS

Contents

Description

MongoDB GridFS implementation

Synopsis

Documentation

data Bucket Source #

Files are stored in "buckets". You open a bucket with openDefaultBucket or openBucket

Setup

openDefaultBucket :: (Monad m, MonadIO m) => Action m Bucket Source #

Open the default Bucket (named "fs")

Query

findFile :: (MonadIO m, MonadBaseControl IO m) => Bucket -> Selector -> Action m [File] Source #

Find files in the bucket

findOneFile :: MonadIO m => Bucket -> Selector -> Action m (Maybe File) Source #

Find one file in the bucket

fetchFile :: MonadIO m => Bucket -> Selector -> Action m File Source #

Fetch one file in the bucket

Delete

deleteFile :: MonadIO m => File -> Action m () Source #

Delete files in the bucket

Conduits

sourceFile :: (Monad m, MonadIO m) => File -> Producer (Action m) ByteString Source #

A producer for the contents of a file

sinkFile :: (Monad m, MonadIO m) => Bucket -> Text -> Consumer ByteString (Action m) File Source #

A consumer that creates a file in the bucket and puts all consumed data in it