Search code examples
meteormethodssimple-schema

How to get a collections attached schema with Meteors aldeed:simpleschema and mdg:validated-method


I want to created an automatically validated method like the one here but using a schema already defined and attached to a collection.

To this end is there a way to extract a collections attached schema, something like:

  validate: Books.getSchema().validator(),

?

Thanks!


Solution

  • it's Books.simpleSchema() this returns the schema object attached to the given collection