Couchbase N1QL - inline Regex captured group replace?

Viewed 193
UPDATE SOME_BUCKET as doc USE KEYS ["USER_ACCESS::123456::SOME_ROLE", "MORE KEYS HERE...", etc]
loc.id = REGEXP_REPLACE(loc.id, "(.*) - (.*)", "$1-$2") FOR loc IN locations END
RETURNING doc

Setting the "loc.id" here just assigns it the string literal replacement value, "$1-$2" instead of the back references to the captured groups.

Couchbase Server runs GoLang regex syntax, which apparently might not support back references? What alternative is there?

1 Answers
Related