The databases
method of the IDBFactory
interface returns a list represening all the available databases, including their names and versions.
Note: This feature is available in Web Workers.
Note: This method is introduced in a draft of a specifications and browser compatibility is limited.
Syntax
const promise = indexedDB.databases()
Parameters
The method does not take in any parameters.
Return value
A promise that resolves either to an error or a list of dictionaries, each with two elements, name
and version
.
name
The database name.
version
The database version.
Exceptions
This method may raise a DOMException
of the following types:
Attribute | Description |
---|---|
SecurityError
|
The method is called from an opaque origin. |
Other error | Specification does not describe all possible errors. |
Example
const promise = indexedDB.databases() promise.then(databases => { console.log(databases) })
Specifications
Specification | Status | Comment |
Indexed Database API DraftThe definition of 'databases()' in that specification. | Recommendation | Initial definition. |
Browser compatibility
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.
Update compatibility data on GitHub
Desktop | Mobile | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
|
Chrome
Full support 71 |
Edge
Full support 79 |
Firefox No support No No support No Notes' See bug 934640. |
IE
No support No |
Opera
Full support 58 |
Safari
Full support 14 |
WebView Android
Full support 71 |
Chrome Android
Full support 71 |
Firefox Android No support No No support No Notes' See bug 934640. |
Opera Android
Full support Yes |
Safari iOS
Full support 14 |
Samsung Internet Android
Full support 10.0 |
Legend
- Full support
- Full support
- No support
- No support
- Experimental. Expect behavior to change in the future.'
- Experimental. Expect behavior to change in the future.
- See implementation notes.'
- See implementation notes.
See also
- Using IndexedDB
- Starting transactions:
IDBDatabase
- Using transactions:
IDBTransaction
- Setting a range of keys:
IDBKeyRange
- Retrieving and making changes to your data:
IDBObjectStore
- Using cursors:
IDBCursor
- Reference example: To-do Notifications ([[../../../../../../../mdn.github.io/to-do-notifications/index|view example live]].)
databases by Mozilla Contributors is licensed under CC-BY-SA 2.5.