You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
potato-launcher/extensions/pouchdb/stores/pouchdbHandler.js

51 lines
908 B

2 years ago
import PouchDB from 'pouchdb'
import PouchDBfind from 'pouchdb-find'
/**
* PouchdbHandler, for create
2 years ago
*
* @author Björn Hase
* @license https://www.gnu.org/licenses/gpl-3.0.en.html GPL-3
* @link https://gitea.node001.net/HerrHase/potato-launcher.git
2 years ago
*
*/
class PouchdbHandler {
/**
*
*
*/
constructor() {
PouchDB.plugin(PouchDBfind)
this.db = new PouchDB('.storage/pouchdb/apps', {
revs_limit: 0
})
}
2 years ago
/**
* adding index for current class
*
* @param {array} fields
*
*/
createIndex(fields) {
2 years ago
// adding index
try {
this.db.createIndex({
index: {
fields: fields
}
}).then(() => {
})
} catch (error) {
console.log(error)
2 years ago
}
2 years ago
}
}
export default PouchdbHandler