一、数据库基本命令
1. 扫描所有数据表
scan 0
2. 扫描hash表Real_Gps中的两条记录
HSCAN Real_Gps 0 MATCH * COUNT 2
二、RedisTemplate操作scan
//1. 一次性获取Real_Gps中数据
Map<Object, Object> map1 =redisTemplate.opsForHash().entries(env.getProperty("Real_Gps"));
//2. 使用Scan方式遍历获取Real_Gps中的数据
ScanOptions scanOptions = ScanOptions.scanOptions().count(1).match("*").build();
Cursor<Entry<Object, Object>> cursor = redisTemplate.opsForHash().scan("Real_Gps", scanOptions);
while(cursor.hasNext()) {
Map.Entry<Object, Object> entry = cursor.next();
entry.getKey();
entry.getValue();
}