title: Angular and PouchDBFind plugin
body: <p>I have an angular application in which I want to use PouchDB with the PouchDBFind plugin.</p>
  
  <p>I've already gotten PouchDB to work. But I can't figure out how I use the PouchDB Plugin.</p>
  
  <p>Example database setup:</p>
  
  <pre><code>constructor() {
      this.db = new PouchDB('exampleDb');
      this.db.createIndex({
          index: {fields: ['number', 'name']}
      }).catch(error =&gt; {
          console.log(error);
      });
  }
  </code></pre>
  
  <p>I always get this error:</p>
  
  <pre><code>ERROR Error: Uncaught (in promise): TypeError: this.db.createIndex is not a function 
  TypeError: this.db.createIndex is not a function
  </code></pre>
  
  <p>This is how my import statements are:</p>
  
  <pre><code>import * as PouchDB from 'pouchdb';
  import * as PouchFind from 'pouchdb-find';
  PouchDB.plugin(PouchFind);
  </code></pre>
  
  <p>I don't get any errors here.</p>
  
  <p>I've already read about another import alternative, but this does <strong>not</strong> work:</p>
  
  <pre><code>import PouchDB from 'pouchdb';
  import PouchFind from 'pouchdb-find';
  </code></pre>
  
  <p>I get this error:</p>
  
  <pre><code>"pouchdb-find" has no default export
  </code></pre>
  
  <p>I have installed the typings.
  So here are my package.json dependencies:</p>
  
  <pre><code>"dependencies": {
      "@types/pouchdb": "6.1.1",
      "@types/pouchdb-find": "^0.10.1",
      "pouchdb": "^6.2.0",
      "pouchdb-find": "^6.3.4"
  },
  </code></pre>
  
  <p>So how do I get the PouchDBFind plugin to work?
  If any more information are required, please notice me.</p>
  
  <p>Thanks in advance!</p>
  
  <p><strong>Edit</strong>:
  After locking the versions to...</p>
  
  <pre><code>"pouchdb": "6.3.4",
  "pouchdb-find": "6.3.4",
  </code></pre>
  
  <p>... I get the following warning after the webpack compilation:</p>
  
  <pre><code>WARNING in ./src/app/services/example-db/example-db.service.ts
  17:8-22 "export 'plugin' (imported as 'PouchDB') was not found in 'pouchdb'
  </code></pre>
  
  <p>And in the browser console:</p>
  
  <pre><code>ERROR Error: Uncaught (in promise): TypeError: __WEBPACK_IMPORTED_MODULE_2_pouchdb__.plugin is not a function
  TypeError: __WEBPACK_IMPORTED_MODULE_2_pouchdb__.plugin is not a function
  </code></pre>
  
  <p>When I comment the <code>PouchDB.plugin(PouchFind)</code> line, the warning is gone but the error in the console remains. It just says that it doesn't have a constructor.</p>
  
  <p><strong>Edit</strong>: It is an angular-cli project.</p>