2014-04-01 58 views

回答

1

据我所知的timestaps不会自动索引...

到索引的字段添加到这个模型

index({ created_at: 1 },{ background: true }) 

,那么你可以创建使用以下命令添加索引

rake db:mongoid:create_indexes