import PouchDB from 'pouchdb' import PouchDBfind from 'pouchdb-find' // adding plugin for index PouchDB.plugin(PouchDBfind) // create database const pouchdb = new PouchDB('./../storage/database', { revs_limit: 5 }) // create fields for index const fields = [ 'type', 'name' ] // adding index try { await pouchdb.db.createIndex({ index: { fields: fields } }) } catch (error) { console.log(error); }