使用正则表达式形式的密钥删除沙发床存储桶中的条目 [英] Delete entry in couchbase bucket using key in the form of regex

查看:80
本文介绍了使用正则表达式形式的密钥删除沙发床存储桶中的条目的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个要求,我必须从该基础存储桶中删除一个条目。我从我传递密钥的Java应用程序中使用CouchbaseCient的delete方法。但是在一种特殊情况下,我没有完整的密钥名称,但只有一部分。因此,我认为有一种方法可以使用匹配器,但找不到。以下是存储在存储桶中的实际密钥

I have a requirement wherein I have to delete an entry from the couchbase bucket. I use the delete method of the CouchbaseCient from my java application to which I pass the key. But in one particular case I dont have the entire key name but a part of it. So I thought that there would be a method that takes a matcher but I could not find one. Following is the actual key that is stored in the bucket

  123_xyz_havefun

我拥有的部分钥匙是xyz。我不确定是否可以做到这一点。任何人都可以提供帮助。

and the part of the key that I have is xyz. I am not sure whether this can be done. Can anyone help.

推荐答案

Couchbase的DELETE操作既不支持通配符,也不支持正则表达式。因此,您必须以某种方式获取键列表并将其传递给函数。例如,您可以使用Couchbase视图或通过APPEND命令维护自己的键列表。就像创建键 xyz 并在应用程序生存期内将所有匹配的键附加到其值上,然后在真正的删除请求后刷新此键

The DELETE operation of the Couchbase doesn't support neither wildcards, nor regular expressions. So you have to get the list of keys somehow and pass it to the function. For example, you might use Couchbase Views or maintain your own list of keys via APPEND command. Like create the key xyz and append to its value all the matching keys during application lifetime with flushing this key after real delete request

这篇关于使用正则表达式形式的密钥删除沙发床存储桶中的条目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆