I have an react app created using create-react-app. So using webpack which is bundled with create-react-app.
I have to use find() of Pouchdb, which I am unable to do. Other Pouch functionality is working fine but find
plugin is not getting attached to Pouch.
import PouchDB from 'pouchdb';
PouchDB.plugin(require('pouchdb-find'));
Versions in package.json :
"pouchdb": "^6.4.1",
"pouchdb-browser": "^6.4.1",
"pouchdb-find": "^6.4.1"
Do anyone have Idea how to fix this. Thanks in advance.
I found the way to solve this problem. Hope it will help others
import PouchDB from 'pouchdb';
import PouchdbFind from 'pouchdb-find';
export class PouchService {
constructor() {
PouchDB.plugin(PouchdbFind);
}
}
After this find() gets included in PouchDB objects.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With