From 692cdb94c7ccab0aa8aa7240b3756ce8dd524c00 Mon Sep 17 00:00:00 2001 From: Victor Denisov Date: Tue, 11 Oct 2016 23:31:16 -0700 Subject: [PATCH] Mark update command as failed if there are write concern errors --- Database/MongoDB/Query.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Database/MongoDB/Query.hs b/Database/MongoDB/Query.hs index 5c775a2..a9d60bb 100644 --- a/Database/MongoDB/Query.hs +++ b/Database/MongoDB/Query.hs @@ -677,7 +677,7 @@ updateBlock ordered col (prevCount, docs) = do let writeErrors = map docToWriteError $ fromMaybe [] (doc !? "writeErrors") let upsertedDocs = fromMaybe [] (doc !? "upserted") return $ UpdateResult - ((not $ true1 "ok" doc) || (length writeErrors > 0)) + ((not $ true1 "ok" doc) || (not $ null writeErrors) || (not $ null writeConcernErrors)) (at "n" doc) (at "nModified" doc) (map docToUpserted upsertedDocs)