mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2025-02-17 17:02:18 -05:00
Changing this back. Using mongodb hint() and explain() on our find() call indicates the compound index is better than the two single indexes.
11 lines
344 B
CoffeeScript
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)
|