codecombat/app/schemas/models/analytics_log_event.coffee
Matt Lott c5977c00fe Add shortened fields to analytics.log.event
We’ll remove the old long fields after we’ve got enough data to switch
over our analytics queries without complication.
2015-01-14 17:51:34 -08:00

20 lines
635 B
CoffeeScript

c = require './../schemas'
AnalyticsLogEventSchema = c.object {
title: 'Analytics Log Event'
description: 'Analytics event logs.'
}
_.extend AnalyticsLogEventSchema.properties,
u: c.objectId(links: [{rel: 'extra', href: '/db/user/{($)}'}])
e: {type: 'integer'}
p: {type: 'object'}
# TODO: Remove these legacy properties after we stop querying for them (probably 30 days, ~2/16/15)
user: c.objectId(links: [{rel: 'extra', href: '/db/user/{($)}'}])
event: {type: 'string'}
properties: {type: 'object'}
c.extendBasicProperties AnalyticsLogEventSchema, 'analytics.log.event'
module.exports = AnalyticsLogEventSchema