simplify findOne
This commit is contained in:
parent
f1fdc0f13b
commit
a3c56b3c2e
1 changed files with 1 additions and 3 deletions
|
@ -504,9 +504,7 @@ find c col sel = query c col [] 0 0 sel []
|
||||||
|
|
||||||
-- | Query, but only return the first result, if any.
|
-- | Query, but only return the first result, if any.
|
||||||
findOne :: Connection -> FullCollection -> Selector -> IO (Maybe BsonDoc)
|
findOne :: Connection -> FullCollection -> Selector -> IO (Maybe BsonDoc)
|
||||||
findOne c col sel = do
|
findOne c col sel = query c col [] 0 (-1) sel [] >>= nextDoc
|
||||||
cur <- query c col [] 0 (-1) sel []
|
|
||||||
nextDoc cur
|
|
||||||
|
|
||||||
-- | Perform a query and return the result as a lazy list. Be sure to
|
-- | Perform a query and return the result as a lazy list. Be sure to
|
||||||
-- understand the comments about using the lazy list given for
|
-- understand the comments about using the lazy list given for
|
||||||
|
|
Loading…
Reference in a new issue