I am using the following code to execute Swift code using Kitura against CouchDB.
database.queryByView("high-priority-tasks", ofDesign: "polls", usingParameters: [], callback: { (json: JSON?, error :NSError?) in
if error != nil {
try! response.status(.internalServerError).end()
}
response.send(json: json!)
})
In my CouchDB I have created the view:
I get the following error back:
po error?.localizedDescription!
▿ Optional<String>
- some : "Error: not_found, reason: missing"
I think ofDesign parameter in queryByView should be the name of the design document (the part after _design/) In your case it is probably "high-priority-tasks" (it is truncated in the field Design Document).