export defFamUpdateOpts
This commit is contained in:
parent
c835d87a66
commit
d2d4f9534c
2 changed files with 9 additions and 9 deletions
|
@ -29,7 +29,7 @@ module Database.MongoDB.Query (
|
||||||
Query(..), QueryOption(NoCursorTimeout, TailableCursor, AwaitData, Partial),
|
Query(..), QueryOption(NoCursorTimeout, TailableCursor, AwaitData, Partial),
|
||||||
Projector, Limit, Order, BatchSize,
|
Projector, Limit, Order, BatchSize,
|
||||||
explain, find, findOne, fetch,
|
explain, find, findOne, fetch,
|
||||||
findAndModify, findAndModifyOpts, FindAndModifyOpts(..),
|
findAndModify, findAndModifyOpts, FindAndModifyOpts(..), defFamUpdateOpts,
|
||||||
count, distinct,
|
count, distinct,
|
||||||
-- *** Cursor
|
-- *** Cursor
|
||||||
Cursor, nextBatch, next, nextN, rest, closeCursor, isCursorClosed,
|
Cursor, nextBatch, next, nextN, rest, closeCursor, isCursorClosed,
|
||||||
|
@ -414,12 +414,12 @@ data FindAndModifyOpts = FamRemove Bool
|
||||||
}
|
}
|
||||||
deriving Show
|
deriving Show
|
||||||
|
|
||||||
findAndModifyUpdate :: Document -> FindAndModifyOpts
|
defFamUpdateOpts :: Document -> FindAndModifyOpts
|
||||||
findAndModifyUpdate ups = FamUpdate
|
defFamUpdateOpts ups = FamUpdate
|
||||||
{ famNew = True
|
{ famNew = True
|
||||||
, famUpsert = False
|
, famUpsert = False
|
||||||
, famUpdate = ups
|
, famUpdate = ups
|
||||||
}
|
}
|
||||||
|
|
||||||
-- | runs the findAndModify command as an update without an upsert and new set to true.
|
-- | runs the findAndModify command as an update without an upsert and new set to true.
|
||||||
-- Returns a single updated document (new option is set to true).
|
-- Returns a single updated document (new option is set to true).
|
||||||
|
@ -430,7 +430,7 @@ findAndModify :: MonadIO m
|
||||||
-> Document -- ^ updates
|
-> Document -- ^ updates
|
||||||
-> Action m (Either String Document)
|
-> Action m (Either String Document)
|
||||||
findAndModify q ups = do
|
findAndModify q ups = do
|
||||||
eres <- findAndModifyOpts q (findAndModifyUpdate ups)
|
eres <- findAndModifyOpts q (defFamUpdateOpts ups)
|
||||||
return $ case eres of
|
return $ case eres of
|
||||||
Left l -> Left l
|
Left l -> Left l
|
||||||
Right r -> case r of
|
Right r -> case r of
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
Name: mongoDB
|
Name: mongoDB
|
||||||
Version: 2.0.1
|
Version: 2.0.2
|
||||||
Synopsis: Driver (client) for MongoDB, a free, scalable, fast, document
|
Synopsis: Driver (client) for MongoDB, a free, scalable, fast, document
|
||||||
DBMS
|
DBMS
|
||||||
Description: This package lets you connect to MongoDB servers and
|
Description: This package lets you connect to MongoDB servers and
|
||||||
|
|
Loading…
Reference in a new issue