code: def _update(collection_name, upsert, multi, spec, doc, check_keys, opts):
      
      flags = 0
      if upsert:
          flags += 1
      if multi:
          flags += 2
      encode = _dict_to_bson  # Make local. Uses extensions.
      encoded_update = encode(doc, check_keys, opts)
      return b"".join([
          _ZERO_32,
          _make_c_string(collection_name),
          _pack_int(flags),
          encode(spec, False, opts),
          encoded_update]), len(encoded_update)
docs: Get an OP_UPDATE message.