hscan
1. 基本語法
hscan(hkey, cursor, ['MATCH', pattern], ['COUNT', count],callback)
hkey, cursor, ['MATCH', pattern], ['COUNT', count],callback) 2. 範例
(1) 預設參數會試圖取得所有hkey資料
hkey資料const dict = {
name: 'John Miller',
gender: 'M',
age: '34',
hobby1 : 'Whistle',
hobby2 : 'War',
hobby3 : 'Walk'
};
client.hmset('user:5', dict);
let cursor = '0';
client.hscan('user:5', cursor , (err, scanner) => {
cursor = scanner[0];
let kv_list = scanner[1];
console.log('Cursor:', cursor);
console.log('Data:', kv_list);
});(2) 模糊篩選subkey
Last updated