mirror of
https://github.com/vale981/Vulcan
synced 2025-03-09 12:16:37 -04:00
14 lines
332 B
JavaScript
14 lines
332 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);
|
||
|
}
|