Created
April 16, 2016 08:38
-
-
Save ronfe/b89db687aef9a036ce4119d6640bc219 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
backSchema = new Schema({ | |
"eventKey": {type: String, required: true}, | |
"eventValue": {type: Mixed}, | |
"ua": String, | |
"url": String, //only for pc, the full url | |
"category": "onionsBackend", // to string | |
"platform": "backend", //Required | |
"ip": String, | |
"location": {type: Mixed}, | |
"user": ObjectId, //Required when user logged in, its user id | |
"role": {"type": String, "enum": ["teacher", "student", "editor", "visitor"]}, | |
"eventTime": {type: Number, required: true}, //Required, timeStamp of points generated, unix epoch time (in ms) | |
"serverTime": {type: Date, default: Date.now} //Server required, Time recorded by server | |
}); | |
[ | |
{ | |
"origin": { | |
"method": "POST", | |
"route": "/signup" | |
}, | |
"track": { | |
"eventKey": "signupSuccess", | |
"eventValue": {"channel": "req.body.channel"}, | |
} | |
}, | |
{ | |
"origin": { | |
"method": "PUT", | |
"route": "/me/progress/:subject/topics/:topicId/entered" | |
}, | |
"track": { | |
"eventKey": "startTopic", | |
"eventValue": {"topicId": "req.params.topicId", "subject": "req.params.subject"} | |
} | |
} | |
] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment