docs: def update(collection_name, upsert, multi, spec, doc, safe, last_error_args):
      """Get an **update** message.
      """
      options = 0
      if upsert:
          options += 1
      if multi:
          options += 2
  
      data = __ZERO
      data += bson._make_c_string(collection_name)
      data += struct.pack("<i", options)
      data += bson.BSON.encode(spec)
      data += bson.BSON.encode(doc)
      if safe:
          (_, update_message) = __pack_message(2001, data)
          (request_id, error_message) = __last_error(last_error_args)
          return (request_id, update_message + error_message)
      else:
          return __pack_message(2001, data)