Files
DiceCloud/rpg-docs/Model/Character/Experience.js
2015-02-27 06:14:34 +00:00

23 lines
591 B
JavaScript

Experiences = new Meteor.Collection("experience");
Schemas.Experience = new SimpleSchema({
charId: {type: String, regEx: SimpleSchema.RegEx.Id},
name: {type: String, defaultValue: "New Experience", trim: false},
description: {type: String, optional: true, trim: false},
value: {type: Number, defaultValue: 0},
dateAdded: {
type: Date,
autoValue: function() {
if (this.isInsert) {
return new Date;
} else if (this.isUpsert) {
return {$setOnInsert: new Date};
} else {
this.unset();
}
}
},
});
Experiences.attachSchema(Schemas.Experience);