-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtrack.js
More file actions
34 lines (32 loc) · 935 Bytes
/
track.js
File metadata and controls
34 lines (32 loc) · 935 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
/**
*
* @authors HellMagic
* @version 1.0
*/
var mongoose = require('mongoose');
var Schema = mongoose.Schema;
var ObjectId = Schema.Types.ObjectId;
/*=====================================
= 此表主要存储用户的行为数据---当作垃圾桶 =
=====================================*/
var TrackSchema = new Schema({
header: {},
eventKey: String,
eventValue: {},
problem: { type: ObjectId, ref: 'Problem'},
video: { type: ObjectId, ref: 'Video' },
activity: { type: ObjectId, ref: 'Activity' },
task: { type: ObjectId, ref: 'Task' },
topic: { type: ObjectId, ref: 'Topic' },
chapter: { type: ObjectId, ref: 'Chapter' },
user: { type: ObjectId, ref: 'User' },
room: { type: ObjectId, ref: 'Room' },
school: { type: ObjectId, ref: 'School' },
tag: { type: ObjectId, ref: 'Tag' },
from: {
type: String,
enum: ['pc', 'mobile'],
default: 'pc'
}
});
mongoose.model('Track', TrackSchema);