How to check if the update was successful in Pymongo? If the record was updated with the same value it should be considered a successful update. ie, Even if the modified count is zero it is considered a successful update. How to do this.
result = _db.testcollection.update_one({"_id": col_id}, {"$set": obj})
return True if result.modified_count > 0 else False
This works well if the value is changed. But I want to return true even when technically the record was not changed because the record is same what we are trying to update.
How to do this?