Updated for current PouchDB api