Vulcan/packages/telescope-lib/lib/collections.js
2015-04-27 09:55:29 +09:00

20 lines
No EOL
422 B
JavaScript

/**
* Add an additional field to a schema.
* @param {Object} field
*/
Meteor.Collection.prototype.registerField = function (field) {
var collection = this;
var fieldSchema = {};
fieldSchema[field.propertyName] = field.propertySchema;
// add field schema to collection schema
collection.attachSchema(fieldSchema);
}
/**
* Global schemas object
* @namespace Telescope.schemas
*/
Telescope.schemas = {};