I'm following IBM's tutorial on CouchDB and ran into a problem viewing my docs. When I visit http://127.0.0.1:5984/_utils/database.html?contacts/_design/contacts/_view/byname#, I can see my docs in the view just fine.
However, when I visit http://127.0.0.1:5984/contacts/_design/contacts/_view/byname (and subsequently try to view the same data in my app via db.view("contacts/byname", {...
), I only see null
results for my key/value pairs.
I don't think it's a security issue; I'm able to see the view in _utils whether I'm logged in or not.
EDIT
Here is the source code for my view:
function(doc) {
if (doc.name) {
emit(doc.name, doc);
}
}
Why can I see it in one place but not the other?