Couchbase CAS value

Hi David,
To get the CAS value under meta attribute we are using below,

 LookupInResult result = srcColl.lookupIn("XXXXX::YYYYYY",
			 Collections.singletonList(LookupInSpec.get("_sync.cas").xattr()));
	System.out.println("CAS:"+result.contentAs(0, String.class));

To get CAS value from getResult,
GetResult srcDoc = srcColl.get(“XXXXX::YYYYYY”);
System.out.println(srcDoc.toString());
System.out.println(srcDoc.cas());

CB version - 6.6
SDK version - 3.0.10

Yes syncgw is also involved - because these documents will synced to mobile devices, but no change/update from mobile devices, only read is allowed.

1 Like