codecombat/server/analytics/AnalyticsPerDay.coffee
Matt Lott 3fd5f49220 Analytics data revamp
Add analytics per-day aggregation collection.
Add analytics strings collection.
Add per-day aggregation mongo insertion script.
Update campaign editor to use aggregation collection.
Update queries to use _id instead of created field.
2015-01-14 11:09:01 -08:00

12 lines
608 B
CoffeeScript

mongoose = require 'mongoose'
AnalyticsPerDaySchema = new mongoose.Schema({
e: {type: Number} # event (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)
fv: {type: Number} # filter value (analytics string ID from analytics.strings)
c: {type: Number} # count
}, {strict: false})
# TODO: Why can't we query against a collection with caps, like 'analytics.perDay'?
module.exports = AnalyticsPerDay = mongoose.model('analytics.perday', AnalyticsPerDaySchema)