function makeLean(val) {
  return function(option) {
    option.options || (option.options = {});

    if (val != null && Array.isArray(val.virtuals)) {
      val = Object.assign({}, val);
      val.virtuals = val.virtuals.
        filter(path => typeof path === 'string' && path.startsWith(option.path + '.')).
        map(path => path.slice(option.path.length + 1));
    }

    option.options.lean = val;
  };
}
Set each path query option to lean

@param {Object} option