'Return a dict containing all the $set and $unset operations
that should be sent to MongoDB based on the changes made to this
Document.'

def _get_update_doc(self):

    (updates, removals) = self._delta()
    update_doc = {}
    if updates:
        update_doc['$set'] = updates
    if removals:
        update_doc['$unset'] = removals
    return update_doc
