<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                合規國際互聯網加速 OSASE為企業客戶提供高速穩定SD-WAN國際加速解決方案。 廣告
                ## 一、字符串 ~~~ 127.0.0.1:6379> SET name redis OK 127.0.0.1:6379> GET name "redis" 127.0.0.1:6379> del name (integer) 1 ~~~ * MGET (多個值的獲取) ~~~ 127.0.0.1:6379> SET key1 "hello" OK 127.0.0.1:6379> SET key2 "world" OK 127.0.0.1:6379> MGET key1 key2 someOtherKey ~~~ * SETEX (將值 value 關聯到 key ,并將 key 的過期時間設為 seconds (以秒為單位)。) ~~~ 127.0.0.1:6379> SETEX mykey 60 redis OK 127.0.0.1:6379> TTL mykey (integer) 54 127.0.0.1:6379> GET mykey "redis" 127.0.0.1:6379> ~~~ * SETNX key value(只有在 key 不存在時設置 key 的值。) ~~~ redis> EXISTS job # job 不存在 (integer) 0 redis> SETNX job "programmer" # job 設置成功 (integer) 1 redis> SETNX job "code-farmer" # 嘗試覆蓋 job ,失敗 (integer) 0 redis> GET job # 沒有被覆蓋 "programmer" ~~~ * STRLEN key(返回 key 所儲存的字符串值的長度。) ~~~ # 獲取字符串的長度 redis> SET mykey "Hello world" OK redis> STRLEN mykey (integer) 11 # 不存在的 key 長度為 0 redis> STRLEN nonexisting (integer) 0 ~~~ * [MSET key value 【同時設置一個或多個 key-value 對。】](https://www.runoob.com/redis/strings-mset.html) ~~~ redis 127.0.0.1:6379> MSET key1 "Hello" key2 "World" OK redis 127.0.0.1:6379> GET key1 "Hello" redis 127.0.0.1:6379> GET key2 1) "World" ~~~ * [SETRANGE key offset value【用 value 參數覆寫給定 key 所儲存的字符串值,從偏移量 offset 開始。】](https://www.runoob.com/redis/strings-setrange.html) ~~~ redis 127.0.0.1:6379> SET key1 "Hello World" OK redis 127.0.0.1:6379> SETRANGE key1 6 "Redis" (integer) 11 redis 127.0.0.1:6379> GET key1 "Hello Redis" ~~~ * [INCR key【將 key 中儲存的數字值增一。】](https://www.runoob.com/redis/strings-incr.html) ~~~ redis> SET page_view 20 OK redis> INCR page_view (integer) 21 redis> GET page_view # 數字值在 Redis 中以字符串的形式保存 "21" ~~~ * [INCRBY key increment【將 key 所儲存的值加上給定的增量值(increment)】](https://www.runoob.com/redis/strings-incrby.html) ~~~ # key 存在且是數字值 redis> SET rank 50 OK redis> INCRBY rank 20 (integer) 70 redis> GET rank "70" # key 不存在時 redis> EXISTS counter (integer) 0 redis> INCRBY counter 30 (integer) 30 redis> GET counter "30" # key 不是數字值時 redis> SET book "long long ago..." OK redis> INCRBY book 200 (error) ERR value is not an integer or out of range ~~~ * [DECR key【將 key 中儲存的數字值減一】](https://www.runoob.com/redis/strings-decr.html) ~~~ # 對存在的數字值 key 進行 DECR redis> SET failure_times 10 OK redis> DECR failure_times (integer) 9 # 對不存在的 key 值進行 DECR redis> EXISTS count (integer) 0 redis> DECR count (integer) -1 # 對存在但不是數值的 key 進行 DECR redis> SET company YOUR_CODE_SUCKS.LLC OK redis> DECR company (error) ERR value is not an integer or out of range ~~~ * [DECRBY key decrement【key 所儲存的值減去給定的減量值(decrement)】](https://www.runoob.com/redis/strings-decrby.html) ~~~ # 對已存在的 key 進行 DECRBY redis> SET count 100 OK redis> DECRBY count 20 (integer) 80 # 對不存在的 key 進行DECRBY redis> EXISTS pages (integer) 0 redis> DECRBY pages 10 (integer) -10 ~~~ * [APPEND key value【如果 key 已經存在并且是一個字符串, APPEND 命令將指定的 value 追加到該 key 原來值(value)的末尾。】](https://www.runoob.com/redis/strings-append.html) ~~~ # 對不存在的 key 執行 APPEND redis> EXISTS myphone # 確保 myphone 不存在 (integer) 0 redis> APPEND myphone "nokia" # 對不存在的 key 進行 APPEND ,等同于 SET myphone "nokia" (integer) 5 # 字符長度 # 對已存在的字符串進行 APPEND redis> APPEND myphone " - 1110" # 長度從 5 個字符增加到 12 個字符 (integer) 12 redis> GET myphone "nokia - 1110" ~~~
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看