code: def update_user_attributes(self, id, old_attrs, new_attrs):
          
          from alerta.utils.collections import merge
          merge(old_attrs, new_attrs)
          attrs = {k: v for k, v in old_attrs.items() if v is not None}
          update = {
              '$set': {'attributes': attrs}
          }
          response = self.get_db().users.update_one({'_id': {'$regex': '^' + id}}, update=update)
          return response.matched_count > 0
docs: Set all attributes and unset attributes by using a value of 'null'.