<commit_before>// ======== DB-Model: ========
// "_id" -> ID
// "name" -> string
// "categories" -> [ID_categories]
// "tags" -> list ID_categories
// "description" -> string
// "slug" -> string
// "region" -> ID_region
// "date" -> timestamp     what for?
// "createdby" -> ID_users
// "time_created" -> timestamp
// "time_lastedit" -> timestamp
// "time_lastenrol" -> timestamp
// "roles" -> [role-keys]
// "members" -> [{"user":ID_user,"roles":[role-keys]},"comment":string]
// ===========================

Courses = new Meteor.Collection("Courses");

var CourseSchema = new SimpleSchema({
	name: { type: String },
	description: { type: String },
	'members.$.user':  { type: String },
	'members.$.roles':  { type: [String] }
});

Courses.attachSchema(CourseSchema);<commit_msg>extend course schema<commit_after>// ======== DB-Model: ========
// "_id" -> ID
// "name" -> string
// "categories" -> [ID_categories]
// "tags" -> list ID_categories
// "description" -> string
// "slug" -> string
// "region" -> ID_region
// "date" -> timestamp     what for?
// "createdby" -> ID_users
// "time_created" -> timestamp
// "time_lastedit" -> timestamp
// "time_lastenrol" -> timestamp
// "roles" -> [role-keys]
// "members" -> [{"user":ID_user,"roles":[role-keys]},"comment":string]
// ===========================

Courses = new Meteor.Collection("Courses");

var CourseSchema = new SimpleSchema({
	name: { type: String },
	region: { type: String },
	categories: { type: [String], optional: true },
	description: { type: String, optional: true },
	roles: { type: [String] },
	time_lastedit: { type: Date },
	time_created: { type: Date },
	slug: { type: String, optional: true },
	'members.$.user':  { type: String },
	'members.$.comment':  { type: String, optional: true },
	'members.$.roles':  { type: [String] }
});

Courses.attachSchema(CourseSchema);
{'fraction_non_alphanumeric': 0.2532467532467532, 'fraction_numerical': 0.0, 'mean_word_length': 3.8403141361256545, 'pattern_counts': {'":': 6, '<': 3, '<?xml version=': 0, '>': 31, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4854877', 'n_tokens_mistral': 618, 'n_tokens_neox': 611, 'n_words': 136}