The IDBVersionChangeRequest.setVersion method updates the version of the database, returning immediately and running a versionchange transaction on the connected database in a separate thread.

For older WebKit browsers, call this method before creating or deleting an object store.

Warning: The latest draft of the specification has dropped this method. Some not up-to-date browsers still implement this method. The new way is to define the version in the method and create and delete object stores in the onupgradeneeded event handler associated with the returned request.


IDBVersionChangeRequest setVersion ([TreatNullAs=EmptyString] in DOMString version);




The version to store in the database.


The request to change the version of a database.

Browser compatibility

Update compatibility data on GitHub
ChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidEdge MobileFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internet
Basic support
Chrome No support NoEdge No support NoFirefox No support NoIE No support NoOpera No support NoSafari No support NoWebView Android No support NoChrome Android No support NoEdge Mobile No support NoFirefox Android No support NoOpera Android No support NoSafari iOS No support NoSamsung Internet Android No support No


No support  
No support
Non-standard. Expect poor cross-browser support.
Non-standard. Expect poor cross-browser support.
Deprecated. Not for use in new websites.
Deprecated. Not for use in new websites.

See also

Document Tags and Contributors

Contributors to this page: fscholz, chrisdavidmills
Last updated by: fscholz,