Hi Team,
we are trying to get CAS value for a given CB document we see some differences. When we get the document from Java SDK and get the CAS value it is displaying different value than the actual document meta cas value. any reason why is this different coming up?
CAS - actual CB - under meta - 0x0000776f93608316
from Getdocument API - 1622246483560562688
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.
Hi Adam,
ok then can we relay on what ever we get from getresult-> cas ? how is this value is getting generated. Is there internal value stored in document level? just for our understanding.
_sync.cas is used internally as part of Sync Gateway’s import processing, and isn’t part of the CAS check used for SDK operations. It’s stored in a system xattr (which is why you see it in meta), but it’s not intended (or required) for use by anyone other than Sync Gateway.