IndexedDB資料庫介紹
In order to retrieve data efficiently from an IndexedDB database, each record is organized by its key. The only condition for the key is that it is a valid key. A valid key can be one of the following types:
1. Array (Is only valid when every item inside the array is a valid key and the array doesn’t contains it self. Also all non-numeric properties are ignored and will not affect whether the array is a valid key)
2. DOMString
3. Date (The Primitivevalue (internal property) of the date object can’t be NaN)
4. Float (The key can’t be NaN)
When comparing keys, the order in the list above applies. Array is greater than all DOMStrings, DOMString is greater than …
Comparing arrays is done by comparing the values inside the array (as long that both arrays got values on the position). If the values on the same position differ, then the outcome of that comparison will determine which array is greater. If the values on each position are the same, the length of the array will determine the which one is greater or equal if the arrays have the same length.
1. Array (Is only valid when every item inside the array is a valid key and the array doesn’t contains it self. Also all non-numeric properties are ignored and will not affect whether the array is a valid key)
2. DOMString
3. Date (The Primitivevalue (internal property) of the date object can’t be NaN)
4. Float (The key can’t be NaN)
When comparing keys, the order in the list above applies. Array is greater than all DOMStrings, DOMString is greater than …
Comparing arrays is done by comparing the values inside the array (as long that both arrays got values on the position). If the values on the same position differ, then the outcome of that comparison will determine which array is greater. If the values on each position are the same, the length of the array will determine the which one is greater or equal if the arrays have the same length.
Complex Keys
The IndexedDB API also support complex keys. This are keys who refer to properties nested inside an object. This way you are able to filter on data that is available are properties of a nested object. In the example below we have an person object. Besides a name and firstname property it contains an address property. This address property is also an object containing properties like city, street, … If we want to filter data on its city we can do this by defining a key like this “address.city”.
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/301743/viewspace-740808/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- indexedDB 資料庫 索引Index資料庫索引
- indexedDB 資料庫版本Index資料庫
- IndexedDB 資料庫概述Index資料庫
- IndexedDB 資料庫用法Index資料庫
- IndexedDB 資料庫新增資料Index資料庫
- 資料庫介紹資料庫
- indexedDB 資料庫主鍵Index資料庫
- indexedDB 刪除資料庫Index資料庫
- 資料庫介紹--初識資料庫資料庫
- L10資料庫——資料庫介紹資料庫
- HSQL 資料庫介紹(1)--簡介SQL資料庫
- MySQL資料庫鎖介紹MySql資料庫
- postgresql資料庫鎖介紹SQL資料庫
- 前端的資料庫:IndexedDB入門前端資料庫Index
- 資料倉儲—資料庫—Oracle 介紹資料庫Oracle
- 資料庫安全知識介紹資料庫
- QuestDB時序資料庫介紹資料庫
- HSQL 資料庫介紹(2)--使用SQL資料庫
- 資料倉儲—資料庫—SQL Server 介紹資料庫SQLServer
- indexedDB 刪除物件倉庫所有資料Index物件
- 瀏覽器資料庫 IndexedDB(一) 概述瀏覽器資料庫Index
- H2 資料庫介紹(1)--簡介資料庫
- indexedDB 更新資料Index
- indexedDB 新增資料Index
- 資料庫基礎知識介紹!資料庫
- MongoDB 資料庫介紹及安裝MongoDB資料庫
- Oracle資料庫審計功能介紹Oracle資料庫
- RAC資料庫後臺程式介紹資料庫
- Oracle資料庫字符集介紹Oracle資料庫
- IndexedDB.open()開啟與新建資料庫Index資料庫
- IndexedDB.open() 開啟與新建資料庫Index資料庫
- 瀏覽器資料庫 IndexedDB 入門教程瀏覽器資料庫Index
- HTML5 進階系列:indexedDB 資料庫HTMLIndex資料庫
- 國產資料庫:達夢資料庫的幾個版本介紹資料庫
- 時序資料庫分析-TimescaleDB時序資料庫介紹資料庫
- 崑崙分散式資料庫架構介紹分散式資料庫架構
- 資料庫複製(一)–複製介紹資料庫
- 達夢透明分散式資料庫介紹分散式資料庫