-
Notifications
You must be signed in to change notification settings - Fork 54
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
Fixes #36 - Add support for CouchDB lists #37
Conversation
If a list is specified in config.list_name or a collection's db.list attribute, the collection will be built based on the list.
A note on implementation - your list function should return a stringified object containing a Example list function:
Also: If you wish to base a collection on a Testing: I have tested the javascript version of this. I made the coffeescript changes by hand, but have not yet tested them. (haven't started working with coffeescript yet) Why would I want to use a Most of the documentation I've read about CouchDB Example
|
Oops - left out one important 'if' in the previous commit. Should be working in .js and .coffee now.
The second commit is the correct one - it contains all of the changes from the first, plus an important |
Thx for this addition, didn't know that you can use lists in that way :). |
Fixes #36 - Add support for CouchDB lists
Feel free to reuse my text, but I should add that I discussed this use of lists with some CouchDB experts on #couchdb, and they informed me that this should be used sparingly - only where it's impossible to get the same results with a view. The reason for this is that views are prepared beforehand, but lists must be built each time they're called. In short, if you need JSON, use a view whenever possible, and only use a list when there's no way to get the same results with a view. |
If a list is specified in config.list_name or a collection's db.list attribute, the collection will be built based on the list.
If no list is specified, the collection is based on the specified view, as in the previous version.