How do I DRY up my CouchDB views?

后端 未结 5 817
甜味超标
甜味超标 2020-12-06 00:17

What can I do to share code among views in CouchDB?

Example 1 -- utility methods

Jesse Hallett has some good utility methods, including

fun         


        
5条回答
  •  感情败类
    2020-12-06 01:12

    You can't do this (last I checked) because the views are stored in the database, and the key for the view is a hash of itself. A view cannot rely on outside data/logic/programming, because if it changes then the view is different and won't match. It confused me, and still does, so I may be wrong.

提交回复
热议问题