Skip to content

Instantly share code, notes, and snippets.

@ronycohen
Created October 30, 2015 15:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ronycohen/b81b3ef51290439bceb5 to your computer and use it in GitHub Desktop.
Save ronycohen/b81b3ef51290439bceb5 to your computer and use it in GitHub Desktop.
error ==> no_usable_index: Database encountered an unknown error
var db = new PouchDB(cloudantURL);
db.createIndex({
index: {
fields: ['_id'],
name: 'addressesIndex',
ddoc: 'addressesddoc',
type: 'json'
}
})
.then(function (result) {
console.log("--Index:",result);
return db.find({
selector: {
geometry: {'$exists': true}
},
fields: ['_id', 'geometry', 'geohash'],
sort: ['_id']
});
})
.then(function (result) {
console.log(result);
// yo, a result
})
.catch(function (err) {
console.log(err);
// ouch, an error
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment