<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智能體構建引擎,智能編排和調試,一鍵部署,支持知識庫和私有化部署方案 廣告
                ## 第十節:IDBKeyRange 對象 `IDBKeyRange`對象代表數據倉庫(object store)里面的一組主鍵。根據這組主鍵,可以獲取數據倉庫或索引里面的一組記錄。 `IDBKeyRange`可以只包含一個值,也可以指定上限和下限。它有四個靜態方法,用來指定主鍵的范圍。 * `IDBKeyRange.lowerBound()`:指定下限。 * `IDBKeyRange.upperBound()`:指定上限。 * `IDBKeyRange.bound()`:同時指定上下限。 * `IDBKeyRange.only()`:指定只包含一個值。 下面是一些代碼實例。 ~~~ // All keys ≤ x var r1 = IDBKeyRange.upperBound(x); // All keys < x var r2 = IDBKeyRange.upperBound(x, true); // All keys ≥ y var r3 = IDBKeyRange.lowerBound(y); // All keys > y var r4 = IDBKeyRange.lowerBound(y, true); // All keys ≥ x && ≤ y var r5 = IDBKeyRange.bound(x, y); // All keys > x &&< y var r6 = IDBKeyRange.bound(x, y, true, true); // All keys > x && ≤ y var r7 = IDBKeyRange.bound(x, y, true, false); // All keys ≥ x &&< y var r8 = IDBKeyRange.bound(x, y, false, true); // The key = z var r9 = IDBKeyRange.only(z); ~~~ `IDBKeyRange.lowerBound()`、`IDBKeyRange.upperBound()`、`IDBKeyRange.bound()`這三個方法默認包括端點值,可以傳入一個布爾值,修改這個屬性。 與之對應,`IDBKeyRange`對象有四個只讀屬性。 * `IDBKeyRange.lower`:返回下限 * `IDBKeyRange.lowerOpen`:布爾值,表示下限是否為開區間(即下限是否排除在范圍之外) * `IDBKeyRange.upper`:返回上限 * `IDBKeyRange.upperOpen`:布爾值,表示上限是否為開區間(即上限是否排除在范圍之外) `IDBKeyRange`實例對象生成以后,將它作為參數輸入`IDBObjectStore`或`IDBIndex`對象的`openCursor()`方法,就可以在所設定的范圍內讀取數據。 ~~~ var t = db.transaction(['people'], 'readonly'); var store = t.objectStore('people'); var index = store.index('name'); var range = IDBKeyRange.bound('B', 'D'); index.openCursor(range).onsuccess = function (e) { var cursor = e.target.result; if (cursor) { console.log(cursor.key + ':'); for (var field in cursor.value) { console.log(cursor.value[field]); } cursor.continue(); } } ~~~ `IDBKeyRange`有一個實例方法`includes(key)`,返回一個布爾值,表示某個主鍵是否包含在當前這個主鍵組之內。 ~~~ var keyRangeValue = IDBKeyRange.bound('A', 'K', false, false); keyRangeValue.includes('F') // true keyRangeValue.includes('W') // false ~~~
                  <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>

                              哎呀哎呀视频在线观看