mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2025-03-24 19:59:53 -04:00
Remove analytics.log.event created field
_id field already has created data: http://docs.mongodb.org/manual/reference/object-id/ Also some misc analytics cleanup.
This commit is contained in:
parent
140a93b453
commit
e79cadc761
5 changed files with 7 additions and 9 deletions
|
@ -6,7 +6,6 @@ AnalyticsLogEventSchema = c.object {
|
||||||
}
|
}
|
||||||
|
|
||||||
_.extend AnalyticsLogEventSchema.properties,
|
_.extend AnalyticsLogEventSchema.properties,
|
||||||
created: c.date({title: 'Created', readOnly: true})
|
|
||||||
user: c.objectId(links: [{rel: 'extra', href: '/db/user/{($)}'}])
|
user: c.objectId(links: [{rel: 'extra', href: '/db/user/{($)}'}])
|
||||||
event: {type: 'string'}
|
event: {type: 'string'}
|
||||||
properties: {type: 'object'}
|
properties: {type: 'object'}
|
||||||
|
|
|
@ -7,6 +7,7 @@ AnalyticsPerDaySchema = c.object {
|
||||||
|
|
||||||
_.extend AnalyticsPerDaySchema.properties,
|
_.extend AnalyticsPerDaySchema.properties,
|
||||||
d: {type: 'string'} # yyyymmdd day, e.g. '20150123'
|
d: {type: 'string'} # yyyymmdd day, e.g. '20150123'
|
||||||
|
e: {type: 'integer'} # event (analytics string ID from analytics.strings)
|
||||||
l: {type: 'integer'} # level (analytics ID from analytics.strings)
|
l: {type: 'integer'} # level (analytics ID from analytics.strings)
|
||||||
f: {type: 'integer'} # filter (analytics ID from analytics.strings)
|
f: {type: 'integer'} # filter (analytics ID from analytics.strings)
|
||||||
fv: {type: 'integer'} # filter value (analytics ID from analytics.strings)
|
fv: {type: 'integer'} # filter value (analytics ID from analytics.strings)
|
||||||
|
|
|
@ -1,11 +1,7 @@
|
||||||
mongoose = require 'mongoose'
|
mongoose = require 'mongoose'
|
||||||
plugins = require '../plugins/plugins'
|
plugins = require '../plugins/plugins'
|
||||||
|
|
||||||
AnalyticsLogEventSchema = new mongoose.Schema({
|
AnalyticsLogEventSchema = new mongoose.Schema({}, {strict: false})
|
||||||
created:
|
AnalyticsLogEventSchema.index({event: 1, _id: 1})
|
||||||
type: Date
|
|
||||||
'default': Date.now
|
|
||||||
}, {strict: false})
|
|
||||||
AnalyticsLogEventSchema.index({event: 1, created: -1})
|
|
||||||
|
|
||||||
module.exports = AnalyticsLogEvent = mongoose.model('analytics.log.event', AnalyticsLogEventSchema)
|
module.exports = AnalyticsLogEvent = mongoose.model('analytics.log.event', AnalyticsLogEventSchema)
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
mongoose = require 'mongoose'
|
mongoose = require 'mongoose'
|
||||||
|
|
||||||
AnalyticsPerDaySchema = new mongoose.Schema({
|
AnalyticsPerDaySchema = new mongoose.Schema({
|
||||||
|
d: {type: String} # yyyymmdd day, e.g. '20150123'
|
||||||
e: {type: Number} # event (analytics string ID from analytics.strings)
|
e: {type: Number} # event (analytics string ID from analytics.strings)
|
||||||
l: {type: Number} # level (analytics string ID from analytics.strings)
|
l: {type: Number} # level (analytics string ID from analytics.strings)
|
||||||
f: {type: Number} # filter (analytics string ID from analytics.strings)
|
f: {type: Number} # filter (analytics string ID from analytics.strings)
|
||||||
|
|
|
@ -22,8 +22,9 @@ class AnalyticsLogEventHandler extends Handler
|
||||||
instance
|
instance
|
||||||
|
|
||||||
getByRelationship: (req, res, args...) ->
|
getByRelationship: (req, res, args...) ->
|
||||||
return @getLevelCompletionsBySlug(req, res) if args[1] is 'level_completions'
|
# TODO: Remove these APIs
|
||||||
return @getCampaignCompletionsBySlug(req, res) if args[1] is 'campaign_completions'
|
# return @getLevelCompletionsBySlug(req, res) if args[1] is 'level_completions'
|
||||||
|
# return @getCampaignCompletionsBySlug(req, res) if args[1] is 'campaign_completions'
|
||||||
super(arguments...)
|
super(arguments...)
|
||||||
|
|
||||||
getLevelCompletionsBySlug: (req, res) ->
|
getLevelCompletionsBySlug: (req, res) ->
|
||||||
|
|
Loading…
Add table
Reference in a new issue