From 3aaee6cf8428f6ec43bc2aa6ad305a4c43034829 Mon Sep 17 00:00:00 2001 From: "Scott R. Parish" Date: Mon, 18 Jan 2010 19:36:10 -0600 Subject: [PATCH] findOne: tell database to only return one --- Database/MongoDB.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Database/MongoDB.hs b/Database/MongoDB.hs index f900783..2c8f431 100644 --- a/Database/MongoDB.hs +++ b/Database/MongoDB.hs @@ -262,7 +262,7 @@ find c col sel = query c col [] 0 0 sel [] -- | Query, but only return the first result, if any. findOne :: Connection -> Collection -> Selector -> IO (Maybe BsonDoc) findOne c col sel = do - cur <- find c col sel + cur <- query c col [] 0 (-1) sel [] el <- nextDoc cur finish cur return el