详解redis在nodejs中的应用

2020-06-17 06:04:06易采站长站整理

//取出所有的键
client.hkeys('phone', cb); //err: null data: [ 'name', 'vendor', 'madein' ] data type: object
//取出所有的值
client.hvals('phone', cb); //err: null data: [ 'iphonex', 'apple', 'china' ] data type: object
//判断键是否存在
client.hexists('phone', 'name', cb); //err: null data: 1 data type: number
client.hexists('phone', 'price', cb); //err: null data: 0 data type: number

五、有序集合数据类型

有序集合会复杂一点,但是可以完成很好的应用程序效果,源码地址:https://github.com/abczhijia/redis-node