From 8f972f6dda6a0f1d126de9e33229cd685bd79250 Mon Sep 17 00:00:00 2001 From: "Scott R. Parish" Date: Sat, 6 Feb 2010 14:52:09 -0600 Subject: [PATCH] fix some haddock problems Unfortunately it seem (emperically) that haddock only allows the pipe character on the first line of document, not on every line. Or more literally, it allows them, but treats them as part of the output to display in the rendered document. Fixing that, it also wasn't happy about not introducing the code block as a new paragraph. --- Database/MongoDB.hs | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/Database/MongoDB.hs b/Database/MongoDB.hs index 09fdb4b..918e6b0 100644 --- a/Database/MongoDB.hs +++ b/Database/MongoDB.hs @@ -570,9 +570,9 @@ addUser c db user pass = do return doc' -- | Conveniently stores the /BsonDoc/ to the /FullCollection/ --- | if there is an _id present in the /BsonDoc/ then it already has --- | a place in the DB, so we update it using the _id, otherwise --- | we insert it +-- if there is an _id present in the /BsonDoc/ then it already has +-- a place in the DB, so we update it using the _id, otherwise +-- we insert it save :: Connection -> FullCollection -> BsonDoc -> IO RequestID save c fc doc = case Map.lookup (s2L "_id") doc of @@ -580,11 +580,13 @@ save c fc doc = Just obj -> update c fc [UFUpsert] (toBsonDoc [("_id", obj)]) doc -- | Use this in the place of the query portion of a select type query --- | This uses javascript and a scope supplied by a /BsonDoc/ to evaluate --- | documents in the database for retrieval. --- | Example: --- | > findOne conn mycoll $ whereClause "this.name == (name1 + name2)" --- | > (toBsonDoc [("name1", toBson "mar"), ("name2", toBson "tha")]) +-- This uses javascript and a scope supplied by a /BsonDoc/ to evaluate +-- documents in the database for retrieval. +-- +-- Example: +-- +-- > findOne conn mycoll $ whereClause "this.name == (name1 + name2)" +-- > (toBsonDoc [("name1", toBson "mar"), ("name2", toBson "tha")]) whereClause :: String -> BsonDoc -> BsonDoc whereClause qry scope = toBsonDoc [("$where", (BsonCodeWScope (s2L qry) scope))]