code: function attachProperties(schema, paths) {
    paths.forEach(path => {
      const props = path.options.attach.properties;
  
      if (props[path.path]) {
        (props[path.path].on || []).forEach(on => {
  
          /**
          * Setup post callbacks
          */
          schema.post(on, function(documents, next) {
            asArray(documents).forEach(function(doc) {
              paths.forEach(function(path) {
                doc[props[path.path].as] = path.enumValues;
              });
            });
  
            next();
          });
        });
      }
    });
  }
docs: Attach properties to the document