1. ioredisNode.js 的 Redis 客戶(hù)端

        聯(lián)合創(chuàng)作 · 2023-09-30 19:57

        ioredis 是一個(gè)用于 Node.js/io.js 的 Redis 客戶(hù)端,強(qiáng)健、功能強(qiáng)大且全面。

        要求 Redis >= 2.6.12 ,Node.js >= 0.10.16)

        具有以下特性

        • 功能完備。支持 Cluster, Sentinel, Pipelining,以及 Lua scripting & Pub/Sub(同時(shí)支持二進(jìn)制消息)

        • 高性能

        • 友好的 API,支持使用 Node callbacks 以及 Bluebird promises

        • 抽象 Lua 腳本,可定義自定義命令

        • 支持二進(jìn)制數(shù)據(jù)

        • 支持 TLS

        • 支持離線(xiàn)隊(duì)列和準(zhǔn)備檢查

        • 支持 ES6 類(lèi)型,例如 Map and Set

        • 支持 GEO 命令(Redis 3.2 Unstable)

        • 完善的錯(cuò)誤處理策略

        示例代碼 - 基本用法

        var Redis = require('ioredis');
        var redis = new Redis();
        redis.set('foo', 'bar');
        redis.get('foo', function (err, result) {
          console.log(result);
        });
        // Or using a promise if the last argument isn't a function
        redis.get('foo').then(function (result) {
          console.log(result);
        });
        // Arguments to commands are flattened, so the following are the same:
        redis.sadd('set', 1, 3, 5, 7);
        redis.sadd('set', [1, 3, 5, 7]);
        // All arguments are passed directly to the redis server:
        redis.set('key', 100, 'EX', 10);
        瀏覽 17
        點(diǎn)贊
        評(píng)論
        收藏
        分享

        手機(jī)掃一掃分享

        編輯 分享
        舉報(bào)
        評(píng)論
        圖片
        表情
        推薦
        點(diǎn)贊
        評(píng)論
        收藏
        分享

        手機(jī)掃一掃分享

        編輯 分享
        舉報(bào)
          
          

            1. 娇妻玩4p被3个男人玩4p | 欧美日韩国产加勒比视频一区 | 欧美在线91 | 自慰免费观看 | 日韩国产精品电影 |