Scan consistency with AT_PLUS in CBQ

Can somebody help me with an example of AT_PLUS in CBQ? When I enable AT_PLUS with:

\SET -scan_consistency AT_PLUS;

Then every N1QL will error out with a “No scan_vector value”.

AT_PLUS with Java or .NET seems to be more straightforward from the various blog posts I’ve seen. Although, using the SDK it does not seem that the scan_vector needs to be calculated manually… :slight_smile:

I’m trying to do an UPDATE to a document and then SELECT COUNT(*) for it.

You need to set scan_vector value as described at https://developer.couchbase.com/documentation/server/5.0/settings/query-settings.html

cc @johan_larson

Thanks @vsr1. I saw that but still not sure how I would get these values:

Scan vectors are built of [value, guard] entries, two-element arrays:

value: a vbucket's sequence number (a JSON number)
guard: a vbucket's UUID (a string)

You shouldn’t try to do this manually. Use the SDK. It will automatically track the entries from KV operations, and supply them with the N1QL queries as scan vectors.

Thanks @johan_larson. I was just trying to do a quick test/proof of concept in CBQ instead of going into the SDK. I tried it with REQUEST_PLUS but I wanted more granular control with AT_PLUS .