Skip to content

Schema's

Shree Tejas edited this page Nov 19, 2019 · 1 revision

User Schema

var userSchema = new Schema({ username: String, email: String, password: String, isInCampus: Boolean, isActive: Boolean, isAdmin: Boolean }, { timestamp: true });

Content Schema

var contentSchema = new Schema({ type: { "type": "string", "enum": ["resource", "challenge"]}, contentUrl: String, title: String, description: String }, { timestamp: true })

Challenge Schema

var challengeSchema = new Schema({ userId: String, contentId: String, hasSubmitted: Boolean, Submission: String, pointsAwarded: String, Type: { "type": "string", "enum": ["individual", "pair", "group"]}, Pair: [{ type: app.mongoose.Schema.ObjectId, ref: 'userSchema'}], Group: [{ type: app.mongoose.Schema.ObjectId, ref: 'userSchema'}], hasOptedOut: boolean, Deadline: { type: Date, default: Date.now } }, { timestamp: true });

Clone this wiki locally