def append(self, key, value, cas=0, ttl=0, format=None): """ Append a string to an existing value in Couchbase. This follows the same conventions as :meth:`~couchbase.libcouchbase.Connection.set`. The `format` argument must be one of :const:`~couchbase.FMT_UTF8` or :const:`~couchbase.FMT_BYTES`. If not specified, it will be :const:`~couchbase.FMT_UTF8` (overriding the :attr:`default_format` attribute). This is because JSON or Pickle formats will be nonsensical when random data is appended to them. If you wish to modify a JSON or Pickle encoded object, you will need to retrieve it (via :meth:`get`), modify it, and then store it again (using :meth:`set`). Additionally, you must ensure the value (and flags) for the current value is compatible with the data to be appended. For an example, you may append a :const:`~couchbase.FMT_BYTES` value to an existing :const:`~couchbase.FMT_JSON` value, but an error will be thrown when retrieving the value using :meth:`get` (you may still use the :attr:`data_passthrough` to overcome this). :raise: :exc:`couchbase.exceptions.NotStoredError` if the key does not exist .. seealso:: :meth:`set` :meth:`append_multi` """ return _Base.append(self, key, value, ttl=ttl, cas=cas, format=format)
def append(self, key, value, cas=0, ttl=0, format=None): """ Append a string to an existing value in Couchbase. This follows the same conventions as :meth:`~couchbase.connection.Connection.set`. The `format` argument must be one of :const:`~couchbase.FMT_UTF8` or :const:`~couchbase.FMT_BYTES`. If not specified, it will be :const:`~couchbase.FMT_UTF8` (overriding the :attr:`default_format` attribute). This is because JSON or Pickle formats will be nonsensical when random data is appended to them. If you wish to modify a JSON or Pickle encoded object, you will need to retrieve it (via :meth:`get`), modify it, and then store it again (using :meth:`set`). Additionally, you must ensure the value (and flags) for the current value is compatible with the data to be appended. For an example, you may append a :const:`~couchbase.FMT_BYTES` value to an existing :const:`~couchbase.FMT_JSON` value, but an error will be thrown when retrieving the value using :meth:`get` (you may still use the :attr:`data_passthrough` to overcome this). :raise: :exc:`couchbase.exceptions.NotStoredError` if the key does not exist .. seealso:: :meth:`set`, :meth:`append_multi` """ return _Base.append(self, key, value, ttl=ttl, cas=cas, format=format)