Safe Haskell | None |
---|
In this module you can find variations of withDB
functions.
Functions from this module are to be used when you have multiple MongoDB snaplets (databases) in your application.
- eitherWithDB :: (MonadIO m, MonadState app m) => SnapletLens app MongoDB -> Action IO a -> m (Either Failure a)
- eitherWithDB' :: (MonadIO m, MonadState app m) => SnapletLens app MongoDB -> AccessMode -> Action IO a -> m (Either Failure a)
- maybeWithDB :: (MonadIO m, MonadState app m) => SnapletLens app MongoDB -> Action IO a -> m (Maybe a)
- maybeWithDB' :: (MonadIO m, MonadState app m) => SnapletLens app MongoDB -> AccessMode -> Action IO a -> m (Maybe a)
- unsafeWithDB :: (MonadIO m, MonadState app m) => SnapletLens app MongoDB -> Action IO a -> m a
- unsafeWithDB' :: (MonadIO m, MonadState app m) => SnapletLens app MongoDB -> AccessMode -> Action IO a -> m a
Documentation
:: (MonadIO m, MonadState app m) | |
=> SnapletLens app MongoDB | The snaplet (database) on which you want the action to be run. |
-> Action IO a |
|
-> m (Either Failure a) |
Database access function.
Example:
eitherWithDB accountDB $ insert "test-collection" [ "some_field" = "something" ]
:: (MonadIO m, MonadState app m) | |
=> SnapletLens app MongoDB | The snaplet (database) on which you want the action to be run. |
-> AccessMode | Access mode you want to use when performing the action. |
-> Action IO a |
|
-> m (Either Failure a) |
Database access function.
Example:
eitherWithDB' accountDB UnconfirmedWrites $ insert "test-collection" [ "some_field" = "something" ]
:: (MonadIO m, MonadState app m) | |
=> SnapletLens app MongoDB | The snaplet (database) on which you want the action to be run. |
-> Action IO a |
|
-> m (Maybe a) |
|
Database access function.
Example:
maybeWithDB accountDB $ insert "test-collection" [ "some_field" = "something" ]
:: (MonadIO m, MonadState app m) | |
=> SnapletLens app MongoDB | The snaplet (database) on which you want the action to be run. |
-> AccessMode | Access mode you want to use when performing the action. |
-> Action IO a |
|
-> m (Maybe a) |
|
Database access function.
Example:
maybeWithDB' accountDB UnconfirmedWrites $ insert "test-collection" [ "some_field" = "something" ]
:: (MonadIO m, MonadState app m) | |
=> SnapletLens app MongoDB | The snaplet (database) on which you want the action to be run. |
-> Action IO a |
|
-> m a | The action's result; in case of failure |
Database access function.
Example:
unsafeWithDB accountDB $ insert "test-collection" [ "some_field" = "something" ]
:: (MonadIO m, MonadState app m) | |
=> SnapletLens app MongoDB | The snaplet (database) on which you want the action to be run. |
-> AccessMode | Access mode you want to use when performing the action. |
-> Action IO a |
|
-> m a | The action's result; in case of failure |
Database access function.
Example:
unsafeWithDB' accountDB UnconfirmedWrites $ insert "test-collection" [ "some_field" = "something" ]