close
Summary
This method synchronously performs the steps for closing a database connection and returns once the database has been closed.
Method of apis/indexeddb/IDBDatabaseapis/indexeddb/IDBDatabase
Syntax
 database.close();
Return Value
No return value
Examples
var dbOpenRequest = window.indexedDB.open("BookShop1");
dbOpenRequest.onsuccess = function(event){
    var db = dbOpenRequest.result;
    // The database is now opened
    db.close(); // Close the database connection
};
Usage
 This is a synchronous method that returns after the connection to the database is closed.
Related specifications
- W3C IndexedDB Specification
- W3C Proposed Recommendation
Attributions
- Microsoft Developer Network: [Windows Internet Explorer API reference Article]