Safe Haskell | None |
---|---|
Language | Haskell2010 |
MongoDB GridFS implementation
- data Bucket
- files :: Bucket -> Text
- chunks :: Bucket -> Text
- data File
- document :: File -> Document
- bucket :: File -> Bucket
- openDefaultBucket :: (Monad m, MonadIO m) => Action m Bucket
- openBucket :: (Monad m, MonadIO m) => Text -> Action m Bucket
- findFile :: MonadIO m => Bucket -> Selector -> Action m [File]
- findOneFile :: MonadIO m => Bucket -> Selector -> Action m (Maybe File)
- fetchFile :: MonadIO m => Bucket -> Selector -> Action m File
- deleteFile :: MonadIO m => File -> Action m ()
- sourceFile :: (Monad m, MonadIO m) => File -> Producer (Action m) ByteString
- sinkFile :: (Monad m, MonadIO m) => Bucket -> Text -> Consumer ByteString (Action m) File
Documentation
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
findOneFile :: MonadIO m => Bucket -> Selector -> Action m (Maybe File) Source #
Find one file in the bucket
Delete
Conduits
sourceFile :: (Monad m, MonadIO m) => File -> Producer (Action m) ByteString Source #
A producer for the contents of a file