Xattr In Couchbase

Hi Team,

While we are studying the XDCR features 7.6 , there is point mention to xdcr replication on xattr field. But when we check in CB UI as shown below it is coming under metadata section and we can not edit it manually. So I had two question on xattr .

  1. What is the significance of this field.
  2. How we can populate value so that we can test XDCR on this field.

xattrs

Please find the link related to CB 7.6.
[Filter a Replication | Couchbase Docs]

Thanks,
Debasis

Xattr is “extended attributes”. They are storoed as along with the other metadata for the document along withr the document key. They are separate from the document data.

They can be set and accessed using the subdoc kv api (mutateIn method), by using xattr()

     List<MutateInSpec> mutations = new ArrayList<>();
     mutations.add(MutateInSpec.upsert("property1.last_modified", System.currentTimeMillis()).createPath().xattr());
     collection.mutateIn("testKey::1234" ,mutations);
     mutations = new ArrayList<>();
     mutations.add(MutateInSpec.upsert("property2.last_modified", System.currentTimeMillis()).createPath().xattr());
     collection.mutateIn("testKey::1234" ,mutations);

@mreiche Thanks for the info. Actually we want to test XDCR with Xattr, could you please help how we can achieve the same.

Thanks,
Debasis

Actually we want to test XDCR with Xattr, could you please help how we can achieve the same.

You populate an xattr like you said you wanted to.

How we can populate value so that we can test XDCR on this field.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.