<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>

                企業??AI智能體構建引擎,智能編排和調試,一鍵部署,支持知識庫和私有化部署方案 廣告
                ## 小程序[云開發](https://so.csdn.net/so/search?q=%E4%BA%91%E5%BC%80%E5%8F%91&spm=1001.2101.3001.7020)云函數更新數組的某一項 #### 比如說在[數組](https://so.csdn.net/so/search?q=%E6%95%B0%E7%BB%84&spm=1001.2101.3001.7020)的第0項的某個元素進行更新 ~~~ db.collection('todos').doc('test').update({ data: { 'user.1.age': 30 }, }) ~~~ 但是1得用變量代替,如下: ``` var value = 'pinglun.1.reply' var num = 1; var value = 'pinglun.' + num + '.reply' db.collection('test').where({ _id:event._id, }).update({ data:{ //本來這里的 [value] 值應該是 'pinglun.1.reply', 但是這里的1(也就是pinglun這個數組的下標)是前端頁面動態傳來,而 'pinglun.1.reply' 這樣的形式是無法使用變量的,所以我選擇在前端頁面就拼接成字符串,然后傳一個變量到云函數,而使用變量的方法就是加一個中括號,[value] [value]:_.push({ openId:event.openId, nickName:event.nickName, avatarUrl:event.avatarUrl }) } }) ``` ### 其他案例: ``` set_db_send_words_text(words_index0,words_index1,words_text) { ???var?that?=?this; ????//獲取哪個用戶發的 ????var?user?=?this.data.userInfo; ????var?user_list?=?this.data.info.user_list; ????var?user_index?=?0; ????for(var?i?in?user_list){ ????????if?(user_list[i].openid?==?user._openid)?{ ????????????user_index?=?user._openid; ????????????break; ????????} ????} ?????that.data.db.collection('dice_many').where({ ????????_id:that.data.room_id, ????????user_list:?that.data.db.command.elemMatch({ ????????????openid:that.data.userInfo._openid, ????????}) ????}).update({ ???????//?data?字段表示需新增的?JSON?數據 ???????data:?{ ????????????"user_list.$.words_index0":words_index0, ????????????"user_list.$.words_index1":words_index1, ????????????"user_list.$.words_text":words_text, ????????????"user_list.$.words_time":new?Date().toLocaleDateString()?+?'?'+?new?Date().toLocaleTimeString(), ????????????play_words_user_index:user_index, ????????????play_words_time:new?Date().toLocaleDateString()?+?'?'+?new?Date().toLocaleTimeString()//播放聲音用的 ?????????}, ???????success:?function?(res)?{?} ?????}) }, ```
                  <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>

                              哎呀哎呀视频在线观看