Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

db.plugin is not a function #71

Open
dharmesh312 opened this issue Mar 26, 2017 · 2 comments
Open

db.plugin is not a function #71

dharmesh312 opened this issue Mar 26, 2017 · 2 comments

Comments

@dharmesh312
Copy link

I included the database but the plugin in not working

var db = new PouchDB('dbname');
db.plugin(require('pouchdb-quick-search'));

@nolanlawson
Copy link
Member

Sorry, I'd need more details in order to help you out... browser, environment, did you npm install, etc.? What's not working?

@chrisweight
Copy link

chrisweight commented Jun 29, 2017

^^ You need to declare the plugin on the pouch db import, rather than on the DB instance:

var PouchDB = require('pouchdb');
PouchDB.plugin(require('pouchdb-quick-search'));

or

import * as PouchDB from 'pouchdb';
import * as pouchQuickSearchPlugin from 'pouchdb-quick-search';
PouchDB.plugin(pouchQuickSearchPlugin);

etc

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants