开发者

Difference between show and list functions

开发者 https://www.devze.com 2023-03-14 01:05 出处:网络
What is the difference between a show and a list function and what is the purpose for them? I\'m studying CouchDB right now and reading bunch of different tutorials for CouchDB but this question neve

What is the difference between a show and a list function and what is the purpose for them?

I'm studying CouchDB right now and reading bunch of different tutorials for CouchDB but this question never was explained caref开发者_运维问答ully. (at least I didn't find it)


A _show function is meant to transform a single document, while a _list function is meant to transform the results of a view.

Both of them are meant to take the data within your document(s) and transform them into some other format. For example, you can render as HTML, XML or any other format you specify via the content-type header. By doing this on the database itself, you can reduce some of the work your application layer needs to perform.

Also, there are ways to use _list functions to do additional filtering and transformation to view results, allowing for a lot more flexibility than a typical view.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号