首页 > 编程知识 正文

redis批量获取数据,redis批量获取数据与key

时间:2023-05-04 18:19:00 阅读:187460 作者:1222

String pattern="TEST"Map<String, Object> resMap=Maps.newHashMap();BoundHashOperations<String, String, String> boundHashOps = redisTemplate.boundHashOps(pattern);try (Cursor<Map.Entry<String, String>> cursor = boundHashOps.scan( ScanOptions.scanOptions().count(perCount).build())) { while (cursor.hasNext()) { Map.Entry<String, String> entry = cursor.next(); // do sth. } }}catch (IOException e) { throw new RuntimeException(e);}

版权声明:该文观点仅代表作者本人。处理文章:请发送邮件至 三1五14八八95#扣扣.com 举报,一经查实,本站将立刻删除。