No, views are not restored until the views property is changed. CouchDB computes a hash on the views property of the design document and uses this hash as the name of the view file.
We use this function a lot: we regularly update our project documents, and until the representations themselves change, the representations are not restored.
BTW: This is also the reason you can use the CommonJS and require() modules in your views, but you are limited by the paths within the views . You can do this, for example:
{ ... "views": { "lib": { "underscore": "... (underscore.js here)" }, "my_view": { "map": "function (doc) { var _ = require('views/lib/underscore'); emit(doc._id, _.pick(doc, 'name', 'address'); }" } } }
But you cannot use require as follows: var _ = require('underscore');
Hope this helps!
source share