【问题标题】:How can I replicate the KEYS yourKey* command using Laravel's Redis facade如何使用 Laravel 的 Redis 外观复制 KEYS yourKey* 命令
【发布时间】: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


猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2017-01-12
  • 2022-12-12
  • 2021-07-22
  • 1970-01-01
  • 2020-10-02
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多