Created
October 30, 2015 15:35
-
-
Save ronycohen/b81b3ef51290439bceb5 to your computer and use it in GitHub Desktop.
error ==> no_usable_index: Database encountered an unknown error
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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