src/model/model.js
function getModel(model) {
  const schemaPaths = model.schema.paths;
  const name = model.modelName;

  const fields = extractPaths(schemaPaths, { name });

  return {
    name,
    fields,
    model
  };
}
function getModel(model) {
  const schemaPaths = model.schema.paths;
  const name = model.modelName;

  const fields = extractPaths(schemaPaths, { name });

  return {
    name,
    fields,
    model
  };
}
function getModel ( model ) { const schemaPaths = model . schema . paths ; const name = model . modelName ; const fields = extractPaths ( schemaPaths , { name } ) ; return { name , fields , model } ; }
Turn mongoose model to graffiti model
@method getModel
@param {Object} model Mongoose model
@return {Object} graffiti model
Turn mongoose model to graffiti model