I am trying to understand CouchDB and couchapp, and as I go, I see the disadvantage of using 'this' in any given context. I understand that show objects receive a document and a request, and they are allowed to work with them with lists and views. These operations are all Javascript objects. But CouchApp also seems to store all kinds of things as strings: README files, Mustache templates, etc. He must somehow get access to them. Is the this statement in the context of show somehow provides access to the root of the design document, providing one access to the objects by means other than the syntax require ?
In Javascript, this must be defined somehow in every context, in particular, "There is a this value associated with each active execution context. The value of this depends on the caller and the type of code being executed and is determined when control enters the execution context. This value related to the execution context is unchanged "(ECMA-262 Spec, 3rd edition, section 10.1. 7). What does this mean in the context of the execution of the doc show CouchDB design function? A view or list function?
source share