PouchDb Query() works in webbrowser but not on " xCode "

Hi,

I developped and tested succesuffly my application through the " ionic serve"

But when I “ionic build ios” and run it via xcode on my iphone 5, the call of allDocs() works fine but the db.query(‘index’, {
key: ‘myKey’,
include_docs: true
});
doesn’t works. Nor the .then() nor the .catch() are triggered. Is there any incompatibility between Cordova / xCode and the db.query() ?

St.

I looked at their docs and they give examples of an Async and just sync way to catch the errors. Can you post your error catching code so I can see what kind you’re using? I’d recommend trying a sync
try {
dbcode here
}catch(error){
console.log(error);
}

to see if you can get more details

Thank you @NorthMcCormick
Unfortunately, using xCode I don’t why, I can’t see any errors/logs out in the xCode console. Don’t why nor the console.log() nor the $log() print anythings…

Anyway, I just got it working few seconds ago
By not using anymore the library: https://github.com/angular-pouchdb/angular-pouchdb

Instead, I went for my own wrapping of PouchDB using the help of: http://www.mircozeiss.com/building-offline-applications-with-angularjs-and-pouchdb/
But just for information for the person who will face the problem/path as me, it’s not Pouch.query() any more but PouchDb.query()

1 Like