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
在这里设置“loc.id”只是为其分配字符串文字替换值“$1-$2”,而不是对捕获的组的反向引用。
couchbase服务器运行golang regex语法,显然可能不支持反向引用?还有什么选择?
1条答案
按热度按时间soat7uwm1#
更新所需集合,unset子句https://docs.couchbase.com/server/current/n1ql/n1ql-language-reference/update.html#update-检查示例3