<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國際加速解決方案。 廣告
                提供json數據格式的序列化和反序列化功能,包含encode和decode兩個方法。 # **示例** t_user表,數據如下: ![](https://img.kancloud.cn/b7/ae/b7aea55df3a0d071d67a930b1f497314_589x141.png) Lua腳本: ``` -- t_user_json.lua local json = require("json") -- 加載json模塊 local ops = require("redisOps") --加載redis操作模塊 local row = ops.rawRow() --數據庫當前變更的一行數據,table類型,key為列名稱 local action = ops.rawAction() --當前數據庫事件,包括:insert、updare、delete local id = row["ID"] --獲取ID列的值 local key = "user_json_"..id -- 定義key if action == "insert" then -- 只監聽insert事件 local password = row["PASSWORD"] --獲取USER_NAME列的值 local createTime = row["CREATE_TIME"] --獲取CREATE_TIME列的值 local result = {} -- 定義一個table result["id"] = id result["userName"] = userName result["password"] = password result["createTime"] = createTime result["source"] = "binlog" -- 數據來源 local val = json.encode(result) -- 將result轉為json ops.SET(key,val) -- 對應Redis的SET命令,第一個參數為key(支持string類型),第二個參數為value end ``` 引入腳本: ``` rule: - schema: eseap table: t_user lua_file_path: lua/t_user_json.lua #lua腳本文件 ``` 同步到Redis的數據如下: ![](https://img.kancloud.cn/45/8f/458f147f0f00f3172cc1d37cad7a1e4d_483x223.jpg)
                  <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>

                              哎呀哎呀视频在线观看