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

                ??一站式輕松地調用各大LLM模型接口,支持GPT4、智譜、豆包、星火、月之暗面及文生圖、文生視頻 廣告
                ## select - 設置查詢字段 ~~~ use \api\Mongodb; // 不傳值則表示查詢所有,即“*” Mongodb::select(); // 指定查詢字段 Mongodb::select('id, name'); ~~~ <br/> ## from - 設置操作的數據表 ~~~ use \api\Mongodb; // 不需要寫表前綴,表前綴應在Mongodb.php中配置 Mongodb::from('table'); ~~~ <br/> ## where - 條件 ~~~ use \api\Mongodb; // 根據主鍵查詢,帶 “_” Mongodb::where([ '_id' => '5ac52ec1d752558b1188a240' ]); // 字段匹配查詢 Mongodb::where([ 'name' => 'test' ]); // 大于 Mongodb::where([ 'field >' => 10 ]); // 大于等于 Mongodb::where([ 'field >=' => 10 ]); // 小于 Mongodb::where([ 'field <' => 10 ]); // 小于等于 Mongodb::where([ 'field <=' => 10 ]); // 不等于 Mongodb::where([ 'field <>' => 0 ]); // IN查詢 Mongodb::where([ 'field IN' => [1,2,3,4,5] ]); // NOT IN查詢 Mongodb::where([ 'field NOTIN' => [1,2,3,4,5] ]); // like Mongodb::where([ 'name LIKE' => 'phpcan' ]); ~~~ <br/> ## order - 排序 ~~~ use \api\Mongodb; // 升序 Mongodb::order([ 'id' => 'ASC' ]); // 降序 Mongodb::order([ 'id' => 'DESC' ]); ~~~ <br/> ## limit - 指定條數 ~~~ use \api\Mongodb; Mongodb::limit(10); // 10到20條 Mongodb::limit(10, 10); ~~~ <br/> ## one - 查詢單條 ~~~ $data = mongodb('table')->select()->where(['id' => 1])->one(TRUE); ~~~ <br/> ## all - 查詢多條 ~~~ $data = mongodb('table')->select() ->where([ 'id' => 1 ]) ->order([ 'id' => 'DESC' ]) ->limit(10) ->all(TRUE); ~~~ <br/> ## add - 寫入數據 ~~~ // 寫入成功返回INSERTID $id = mongodb('table')->add([ 'id' => 1, 'name' => 'test' ]); // 批量寫入,第二個參數設置為TRUE,表示批量寫入 // 返回批量插入數據的ID集合 $ids = mongodb('table')->add([ [ 'id' => 1, 'name' => 'test' ], [ 'id' => 1, 'name' => 'test' ], [ 'id' => 1, 'name' => 'test' ], [ 'id' => 1, 'name' => 'test' ], [ 'id' => 1, 'name' => 'test' ] ], TRUE); ~~~ <br/> ## edit - 更新數據 ~~~ // 更新成功返回影響的記錄條數 $num = mongodb('table')->where([ 'id' => 1 ])->edit([ 'name' => 'new name' ]); // 遞增 mongodb('table')->where([ 'id' => 1 ])->inc([ 'hit' => 1 ]); // 遞減,value為負數則表示遞減 mongodb('table')->where([ 'id' => 1 ])->inc([ 'hit' => -1 ]); ~~~ <br/> ## delete - 刪除數據 ~~~ // 返回刪除條數 $num = mongodb('table')->where([ 'id' => 1 ])->delete(); ~~~ <br/> ## 索引操作 ~~~ // 創建索引,字段必須已經在表中存在 mongodb('table')->createIndex('field'); // 獲取索引 $index = mongodb('table')->getIndex(); print_r($index); // 刪除索引,dropIndex接收的參數是索引名稱,可通過getIndex獲取表中所有索引的名稱 mongodb('table')->dropIndex('name'); ~~~ <br/> ## count - 查詢總數 ~~~ $count = mongodb('table')->where([ 'name' => 'test' ])->count(); ~~~
                  <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>

                              哎呀哎呀视频在线观看