quickFind and quickFind'
This commit is contained in:
parent
183e619362
commit
a5ab7cdb64
1 changed files with 10 additions and 1 deletions
|
@ -27,7 +27,7 @@ module Database.MongoDB
|
||||||
(
|
(
|
||||||
connect, connectOnPort, conClose,
|
connect, connectOnPort, conClose,
|
||||||
delete, insert, insertMany, query, remove, update,
|
delete, insert, insertMany, query, remove, update,
|
||||||
find,
|
find, quickFind, quickFind',
|
||||||
allDocs, allDocs', finish, nextDoc,
|
allDocs, allDocs', finish, nextDoc,
|
||||||
Collection, FieldSelector, NumToSkip, NumToReturn, RequestID, Selector,
|
Collection, FieldSelector, NumToSkip, NumToReturn, RequestID, Selector,
|
||||||
Opcode(..),
|
Opcode(..),
|
||||||
|
@ -179,6 +179,15 @@ see 'query' -}
|
||||||
find :: Connection -> Collection -> Selector -> IO Cursor
|
find :: Connection -> Collection -> Selector -> IO Cursor
|
||||||
find c col sel = query c col [] 0 0 sel Nothing
|
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 ->
|
query :: Connection -> Collection -> [QueryOpt] -> NumToSkip -> NumToReturn ->
|
||||||
Selector -> Maybe FieldSelector -> IO Cursor
|
Selector -> Maybe FieldSelector -> IO Cursor
|
||||||
query c col opts skip ret sel fsel = do
|
query c col opts skip ret sel fsel = do
|
||||||
|
|
Loading…
Reference in a new issue