class Serve
include Mongoid::Document
include Mongoid::Timestamps
include Redis::Objects
field :name, type: String
field :serve_type, type: String
## 接收消息的条数
counter :t_receive
## 发送消息的条数
counter :t_send
belongs_to :itemable, polymorphic: true
belongs_to :user
end
我想以计数器进行排序,执行Serve.desc(:t_receive).page(params[:page]).per(10)
但是返回的集合是随机的 不是按t_receive
字段排序的。求高见!