USE KEYS + WHERE clause - is it possible?

Is it possible to run a USE KEYS query that also takes a WHERE clause?

I can certainly work around this, but it’s safer for this change if I can re-validate the condition on which I figured out my key set.

A contrived example:

UPDATE Bucket 
USE KEYS "documentId"
SET `Value` =  "CORRECT"
 WHERE `Value` = "WRONG"

My workaround is to gather all the documentIds that have Value = "WRONG" and pass them into USE KEYS, but that won’t protect against any race condition where value is set to "NEITHER" in the interim.

USE KEYS, WHERE clause are valid.
USE KEYS avoid IndexScan . USE KEYS first then WHERE clause is applied.

1 Like

I get back:

    "code": 3000,
    "msg": "syntax error - at WHERE",

There is extra comma before WHERE

1 Like