The struggle for the work of any list function. I was fine with the _show and _view functions, but the lists do not seem to work, or I misunderstood what to do! (I will agree to the need for an idiotic guide!)
My project document is as follows:
{
"_id": "_design/lists",
"_rev": "3-d22225b4a28a6ca11484723c3a37201b",
"language": "javascript",
"views": {
"variants": {
"map": "function(doc) { emit(doc.var, doc.number_of_results); }"
}
},
"lists": {
"results": "function(head, req) { var row; while(row = getRow()) {send(row.value);}}"
}
}
When I enter http: // localhost: 5984 / mydb / _design / lists / _view / variant I get a list of name variants, for example:
...{"id":"f050ad9b9f725443cb8c4071f40583b","key":"rs1013940","value":19008},
{"id":"f050ad9b9f725443cb8c4071f40daff","key":"rs1013940","value":19008},
{"id":"f050ad9b9f725443cb8c4071f40b985","key":"rs1021188","value":10197}...
but when I enter http: // localhost: 5984 / mydb / _design / lists / _list / results, I get:
{"error":"list_error","reason":"Invalid path."}
Does anyone know what I'm doing wrong? I tried everything that I can think of, and exchanging this feature for one of the online lessons.
I am using CouchDB version 1.0.1 on Ubuntu 12.04
Thanks a lot, hope someone can help!