mongoDB-2.3.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 #

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

data File #

Setup

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

Open the default Bucket (named "fs")

openBucket :: (Monad m, MonadIO m) => Text -> Action m Bucket #

Open a Bucket

Query

findFile :: MonadIO m => Bucket -> Selector -> Action m [File] #

Find files in the bucket

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

Find one file in the bucket

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

Fetch one file in the bucket

Delete

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

Delete files in the bucket

Conduits

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

A producer for the contents of a file

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

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