Jay Patel
Jay Patel

Reputation: 105

retrieve all objects key store in memcached in java

I stored some objects with key in memcached. But now I want to see which keys are stored in memcached.

How to retrieve all object keys stored in memcached in java?

I want to get keys which is more than 100 stored in memcached. Is it possible?

Upvotes: 3

Views: 4449

Answers (2)

milan
milan

Reputation: 12412

It's not possible, here's the explanation why:

No. memcached doesn't support that and it's not a planned feature. It would be a relatively slow and blocking operation...

UPDATE

FAQ How can you list all keys?

With memcached, you can't list all keys. There is a debug interface, but that is not an advisable usage.

Upvotes: 4

KARASZI István
KARASZI István

Reputation: 31467

Memcached is a simple key/value storage, it does not have key list command, so it's not possible to fetch them. See the available commands here.

You should try a different storage if you want this, for example Redis has KEYS command, with which you can fetch the stored keys, even with a specified pattern: KEYS h?ll?*world

Upvotes: 1

Related Questions