databases
方法在
IDBFactory
interface returns a list represening all the available databases, including their names and versions.
注意 : This method is introduced in a draft of a specifications and browser compatibility is limited.
const promise = indexedDB.databases()
The method does not take in any parameters.
A promise that resolves either to an error or a list of dictionaries, each with two elements,
名称
and
version
.
名称
The database name.
version
The database version.
异常
此方法可能引发
DOMException
of the following types:
| 属性 | 描述 |
|---|---|
SecurityError
|
The method is called from an opaque origin. |
| Other error | Specification does not describe all possible errors. |
const promise = indexedDB.databases()
promise.then(databases => {
console.log(databases)
})
| 规范 | 状态 | 注释 |
|---|---|---|
|
索引数据库 API 草案
The definition of 'databases()' in that specification. |
推荐 | 初始定义。 |
The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request.
更新 GitHub 上的兼容性数据| 桌面 | 移动 | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
databases
|
Chrome 71 | Edge 79 |
Firefox
No
|
IE No | Opera 58 | Safari No | WebView Android 71 | Chrome Android 71 |
Firefox Android
No
|
Opera Android Yes | Safari iOS No | Samsung Internet Android 10.0 |
完整支持
不支持
实验。期望将来行为有所改变。
见实现注意事项。
IDBDatabase
IDBTransaction
IDBKeyRange
IDBObjectStore
IDBCursor
IDBFactory
cmp()
databases
deleteDatabase()
open()
IDBCursor
IDBCursorSync
IDBCursorWithValue
IDBDatabase
IDBDatabaseException
IDBDatabaseSync
IDBEnvironment
IDBEnvironmentSync
IDBFactorySync
IDBIndex
IDBIndexSync
IDBKeyRange
IDBObjectStore
IDBObjectStoreSync
IDBOpenDBRequest
IDBRequest
IDBTransaction
IDBTransactionSync
IDBVersionChangeEvent
IDBVersionChangeRequest