Mark update command as failed if there are write concern errors

This commit is contained in:
Victor Denisov 2016-10-11 23:31:16 -07:00
parent 6fe3cd982d
commit 692cdb94c7

View file

@ -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)