<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def update(self, predicate_value, dct, upsert=False, attribute="_id"):
 """Update an existing document :param predicate_value: The value of the predicate :param dict dct: The dictionary to update with :param bool upsert: Whether this is an upsert action :param str attribute: The attribute to query for to find the object to set this data ond :returns: JSON Mongo client response including the "n" key to show number of objects effected """

        if self.schema:
            jsonschema.validate(dct, self.schema)

        if attribute=="_id" and not isinstance(predicate_value, ObjectId):
            predicate_value = ObjectId(predicate_value)

        predicate = {attribute: predicate_value}


        dct = self._dictionary_to_cursor(dct)

        mongo_response = yield self.collection.update(predicate, dct, upsert)

        raise Return(self._obj_cursor_to_dictionary(mongo_response))