Reputation: 1276
Are mongoid timestamps automatically indexed or do they need to be explicitly indexed? If the latter, how do I index the automatically generated timestamp fields?
http://mongoid.org/en/mongoid/docs/extras.html#timestamps
Upvotes: 0
Views: 365
Reputation: 8055
as far as i know the timestaps are not auto indexed...
to index any field add this to the model
index({ created_at: 1 },{ background: true })
then you can create the added indexes using the following command
rake db:mongoid:create_indexes
Upvotes: 1