This is now maintained here https://github.com/eHealthAfrica/tools-reference/blob/master/view-naming-convention.md
Naming convention for views, starting from the basic case of no reduce functions. Views are couples of arbitrary functions, and as such it is impossible to express their whole variety with a name, so i am just trying to cover the most common cases.
In the case of no reduce function, usually views are just meant to sort documents by a set of properties. An idea in this case is to name them like this:
[<slug>_][if_<property>_is_<value>_]by_(<property>_)+
When a property is nested, just replace the dot .
with an underscore _
. Convert cases to lowercase. Convert underscore separated to no separation.
The slug can contain additional information like the function of the view or the country where it is used (for apps used in several countries).
by_name // the key is doc.name
by_patient_name // the key is doc.patient.name
by_patient_name_patient_referenceno // the key is doc.patient.referenceNo
by_patient_name_patient_referenceno // the key is doc.patient.reference_no
sl_to_print_by_contact_provincecode // the key is doc.contact.province_code
if_case_status_is_open_by_location // case.status === 'open', the key is location
supervisors_by_location // summarising the view logic with the slug "supervisors"
In this case, i would use the same convention, with a prefix expressing the reduce. The reduce part could be structured as follows:
<slug>_[on_<property>_]<map part>
stats_on_patient_age_by_case_status
The case above refers to builtin reduce functions, which should cover the wide majority of uses