codecombat/server/analytics/AnalyticsLogEvent.coffee
Matt Lott 1c1f2be497 Changing analytics.log.event indexes to compound
Changing this back.  Using mongodb hint() and explain() on our find()
call indicates the compound index is better than the two single indexes.
2015-01-06 14:54:56 -08:00

11 lines
344 B
CoffeeScript

mongoose = require 'mongoose'
plugins = require '../plugins/plugins'
AnalyticsLogEventSchema = new mongoose.Schema({
created:
type: Date
'default': Date.now
}, {strict: false})
AnalyticsLogEventSchema.index({event: 1, created: -1})
module.exports = AnalyticsLogEvent = mongoose.model('analytics.log.event', AnalyticsLogEventSchema)