-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unable to query views #4
Comments
I should note that I'm trying to use this inside of a frontend React app, interacting with a local database... Is this meant to be used with a remote db only, or something? |
@paulinder this is due to a breaking change that I accidentally introduced in the latest version. This will be fixed soon. Meanwhile you need to add a map object to each view: var ddoc = {
person: {
views: {
byFirstName: { map: function (doc) {
emit(doc.firstName);
} },
byLastName: { map: function (doc) {
emit(doc.lastName);
} },
byFullName: { map: function (doc) {
emit(doc.firstName + ' ' + doc.lastName);
} }
}
}
}; Apologies!!! |
Thanks for your quick reply - very helpful. I think you meant to have switched each I was able to get some results by making this change. Thank you. |
Yup :-) I'm going to keep this open until it is fixed. Next release you won't need to add |
Each view needs both So I think the You could make Note: If you kept So in summary I'd say the only bug is the documentation (README and example code) and that keeping |
Yes, I'm going to fix this up very soon so it works exactly as specified in the documentation. There was no test for this, so I accidentally broke it last release. |
Just a tad confused by this last comment ... So I think what you said was that the existing docs are correct and you therefore won't be supporting |
hi @colinskow is the bug fixed yet in pouchdb? |
Hi,
After seeding the ddocs, and seeing a 'ddocs updated!' message in the console, when I try to query it throws a
NotFoundError
withddoc books has no view named byTitle
.When I examine the _design/books object in the IndexedDB through chrome dev tools, I can see that the view does actually exist.
Thought it might be related to nolanlawson/pouchdb-find#163 - but I am never able to get it working, even after a refresh/second query.
Any ideas?
Thanks
The text was updated successfully, but these errors were encountered: