IDBVersionChangeEvent: IDBVersionChangeEvent() constructor - Web APIs | MDN

Syntax

js

new IDBVersionChangeEvent(type)
new IDBVersionChangeEvent(type, options)

Parameters

type

A string with the name of the event. It is case-sensitive and browsers set it to versionchange, success, or blocked.

options Optional

An object that, in addition of the properties defined in Event(), can have the following properties:

oldVersion Optional

A number representing the previous version of the database. It defaults to 0.

newVersion Optional

An unsigned long representing the new version of the database, or null if the database is being deleted. It defaults is null.

Return value

A new IDBVersionChangeEvent object.

Examples

For a full working example, see our To-do Notifications app (view example live).

Specifications

Specification
Indexed Database API 3.0
# dom-idbversionchangeevent-idbversionchangeevent

Browser compatibility

Help improve MDN

Learn how to contribute

This page was last modified on by MDN contributors.