Is there an efficient way of using a stored function within views, without 
having the function redeclared for every document that’s parsed?

EG if it was possible to declare a function outside the doc parser:

const matcher = ({name, title}) => {/* do stuff here */}

const formatter = ({info}) => {/* stuff */}

function (doc) {
  if(matcher(doc)) {
    emit(doc._id, formatter(doc))
  }
}

Reply via email to