quickFind and quickFind'

This commit is contained in:
Scott R. Parish 2010-01-16 20:06:01 -06:00
parent 183e619362
commit a5ab7cdb64

View file

@ -27,7 +27,7 @@ module Database.MongoDB
(
connect, connectOnPort, conClose,
delete, insert, insertMany, query, remove, update,
find,
find, quickFind, quickFind',
allDocs, allDocs', finish, nextDoc,
Collection, FieldSelector, NumToSkip, NumToReturn, RequestID, Selector,
Opcode(..),
@ -179,6 +179,15 @@ see 'query' -}
find :: Connection -> Collection -> Selector -> IO Cursor
find c col sel = query c col [] 0 0 sel Nothing
{- | Perform a query and return the result as a lazy list. Be sure to
understand the comments about using the lazy list given for 'allDocs'. -}
quickFind :: Connection -> Collection -> Selector -> IO [BSONObject]
quickFind c col sel = find c col sel >>= allDocs
{- | Perform a query and return the result as a strict list. -}
quickFind' :: Connection -> Collection -> Selector -> IO [BSONObject]
quickFind' c col sel = find c col sel >>= allDocs'
query :: Connection -> Collection -> [QueryOpt] -> NumToSkip -> NumToReturn ->
Selector -> Maybe FieldSelector -> IO Cursor
query c col opts skip ret sel fsel = do