PouchDB - Find() and createIndex() not working

#1

Issue

I have developed ionic application with pouch/couch db backend.My requirement is data are stored in pouch db via ionic page using put(),post() method.Make selector in iOS native page, then pass the selector to ionic page from native page using broad cast plugin.All save, fetch methods are available in ionic code(i.e) ts file.Once request received in ts code, make data fetch and pass records to native page using broad cast plugin. My issue is data fetch not working in ts file, fetch method called but find() and createIndex() not executed. Here I attached my code.

I have used
cordova-plugin-sqlite-2 plugin
pouchdb-adapter-cordova-sqlite 2.0.3 npm

Info

  • Environment: hybrid app
  • Platform: iOS
  • Adapter: cordova-sqlite
  • Server: CouchDB
  • @ionic/cli-utils : 1.19.2
  • ionic (Ionic CLI) : 3.20.0
  • Node : v8.11.3
  • npm : 6.1.0

Reproduce

ionic3-pouchdb-sqlite.zip
Once download my code ->folder path -> npm i -> ionic cordova build ios
Run this application in iOS simulator.Then add value in pouch db, using Employee entry page.In Menu page click Native Page, can able to view log for get(),find(),createIndex() this method.All method declaration is available in employee.ts file( provider class )

#2

couchdb is a nosql base, why do you use sqlite and not pouchdb?

#3

I have used pouchdb adapter as “cordova sqlite” for store data in mobile.While use pouch db adapter must use sqlite plugin.
I followed this link for pouchdb-adapter-cordova-sqlite

#4

I use a pure pouchdb without adapter on mobile without issue… Ans pouchdbfind works

#5

Pouchdb use indexdb or websql storage. Both have size limit. We need unlimited storage. So that we use sqlite plugin. Refer here for more info https://pouchdb.com/adapters.html#pouchdb_in_the_browser