layout: post
title: PouchDB 6.0.0: Labour Day author: Dale Harvey
To celebrate the USA and Canada‘s Labo(u)r Day, we have decided to work extra hard to bring you PouchDB 6.0.0. This release brings early retirement to those features that have done great work over the years, but whose services are no longer necessary (don’t worry, we will pay their pensions in full).
Along with the removed features, we have a large list of bugfixes, documentation work and general improvements for you to enjoy with your BBQ.
PouchDB 5.4.0 introduced some deprecations. In 6.0.0, we have now removed these features permanently:
db.put(doc, id, rev)Please use db.put({_id: id, _rev: rev, data: 'foo'}) instead.
new PouchDB(dbName).thenThe constructor is now stateless. If you need to test whether setup can complete, then new PouchDB(dbName).info() can do that for you.
Note this also applies to the callback style, i.e. new PouchDB(dbName, function (err) { /* ... */ }).
The WebSQL adapter no longer automatically detects the SQLite Plugin in Cordova environments. Please use the pouchdb-adapter-cordova-sqlite plugin instead.
extras APIAPIs like require('pouchdb/extras/ajax') are gone. Instead these have been extracted out into separate packages:
{% include alert/start.html variant=“info”%} {% markdown %} * For the adapters, you'll also need to explicitly register them using PouchDB.plugin(), e.g. PouchDB.plugin(require('pouchdb-adapter-memory')). Please see Custom builds for more info. {% endmarkdown %} {% include alert/end.html%}
getUrl(), getHeaders() from HTTP adapterInstead of the getUrl() API, you can use db.name to determine the URL for HTTP-based adapters. For getHeaders() no replacement is intended. Both APIs were previously undocumented.
optionalDependenciesleveldown and websql are no longer optional dependencies. Instead, websql is removed entirely (use pouchdb-adapter-node-websql instead), and leveldown is now required.
If you want to avoid installing leveldown, then you can use the pouchdb-browser preset if you don't need Node support, or you can use pouchdb-memory if you only need an in-memory database. For all other uses, see Custom builds.
View and filter functions now execute in 'use strict' environments and within a sandbox in Node. If you were depending on non-strict mode or non-sandboxed behavior, then you will need to change your view/filter functions.
As always, please file issues or tell us what you think. And of course, a big thanks to all of our new and existing contributors!