Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
},
index: -1,
denyUpdate: true,
},
updatedAt: {
type: Date,
optional: true,
autoValue() {
return ServerTime.date();
},
index: -1,
},
messageCount: {
type: Number,
defaultValue: 0,
custom: SimpleSchema.denyUntrusted,
},
_participants: {
type: Array,
defaultValue: [],
index: 1,
},
'_participants.$': {
type: String,
regEx: SimpleSchema.RegEx.Id,
},
}));
return Conversation;
};
getUpdatableFields() {
const schema = this._getSchema()._schema;
const fields = { _id: this._id };
for (const key of Object.keys(this)) {
if (schema[key] && !(schema[key].custom && schema[key].custom === SimpleSchema.denyUntrusted) && !schema[key].denyUpdate) {
fields[key] = this[key];
}
}
return fields;
}