0

memcahced値に基づいてエントリを無効にすることは可能ですか?
私のアプリでは、さまざまなグループにユーザーを割り当てており、このマッピングをに保存していmemcachedます。

key = userID
value = groupID

したがって、複数userIdsを1つにマップしgroupIDます。

memcache特定のグループを削除するとき、削除されたグループの値として値を持つストア内のすべてのエントリを削除したいと思いますgroupID。したがって、基本的に、特定の値を持つエントリを削除したいと思います。どうすればいいのですか。

4

2 に答える 2

1

You cannot get key's by value in memcached. What you could do though is have a key called groupID that has a comma separated userID's. If you want to see who is part of a group then you could get the key called groupID and parse out the userID's. Then if you have a key for each userID you could delete them with the parsed userID's. You could use memcached's append function too to just append the userID's to a groupID key when a new user registers for you system.

于 2011-07-27T00:09:36.607 に答える
0

私はあなたが探していることをするかもしれないセットをしばらく前に維持することについてのブログ投稿を書きました。

それは本質的にmikewiedが示唆していることですが、より多くの単語とコードサンプルが含まれています。

于 2011-07-27T05:16:41.993 に答える