【发布时间】:2022-06-13 22:33:46
【问题描述】:
如果您在 Redis CLI 上运行 KEYS yourKey*,它将返回您的 Redis 集群中的所有键值对。
我正在尝试通过以下方法检索我的 Redis 集群中的所有键和值,但似乎都不起作用。我浏览了网络并尝试了以下一些建议,但它们不起作用。我还检查了 Laravel 文档,但没有说明如何执行此操作(或者是否可能)
如果可能的话,我如何在 Laravel 中使用 Redis Facade 实现这一点?
// This is returning null even though the redis cluster does indeed have all these keys and there are values present.
Redis::get('KEYS shopping_cart*');
// Tried this but it still returns null
Redis::get('shopping_cart*');
// Tried this but it returns Cannot use 'KEYS' with redis-cluster.
Redis::keys('shopping_cart*');
// Tried this but it returns Cannot use 'SCAN' with redis-cluster.
Redis::scan('shopping_cart*');
【问题讨论】:
-
你不是在一小时前问过这个确切的问题吗?
标签: php laravel debugging redis