у меня есть три поля в коллекции:
Cards.attachSchema(new SimpleSchema({
foo: {
type: String,
},
bar: {
type: String,
},
foobar: {
type: String,
optional: true,
autoValue() {
if (this.isInsert && !this.isSet) {
return `${foo}-${bar}`;
}
},
},
);
Итак, я хочу, чтобы поле foobar получало значение auto (или default), если оно не задано явно, чтобы возвращать оба значения foo и bar. Это возможно?