mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2024-11-28 18:15:52 -05:00
3fd5f49220
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.
12 lines
400 B
CoffeeScript
12 lines
400 B
CoffeeScript
mongoose = require 'mongoose'
|
|
|
|
# Auto-incrementing number _id
|
|
# http://docs.mongodb.org/manual/tutorial/create-an-auto-incrementing-field/#auto-increment-optimistic-loop
|
|
# TODO: Why strict:false?
|
|
|
|
AnalyticsStringSchema = new mongoose.Schema({
|
|
_id: {type: Number}
|
|
v: {type: String}
|
|
}, {strict: false})
|
|
|
|
module.exports = AnalyticsString = mongoose.model('analytics.string', AnalyticsStringSchema)
|