title: mongodb: how to check update or delete is successful
body: <p>driver is pymongo;</p>
  
  <p>question is: after issuing an update or delete operation, how to check data is successfully written to database? current method at hand seems to check <code>modified_count</code> and <code>deleted_count</code> value in the result; but operating on multiple documents needs to remember how many documents to update or delete and compare those numbers with those in result; this is cumbersome, and sometimes the number is not know beforehand (if the result tells me 5 documents are updated, does that mean there are only 5 documents matching the query and all updated, or there are 7 matching but 2 failed to update); in fact, the answer i want is a simple yes or no: yes means <em>all</em> data has been updated or deleted, and no means otherwise (either partial failure or total failure); are there any better ways to do this (such as checking exceptions, getting a numeric return value, etc.)?</p>