count_cache 与魔法字段 xxx_count 有什么关系呢? 另外 mongoid 能用定义了如下: class Topic include Mongoid::Document field :replies_count, :type => Integer, :default => 0 has_many :replies, :dependent => :destroy end class Reply include Mongoid::Document belongs_to :topic, :inverse_of => :replies end 保存 Reply.create(:topic => @topic._id)...但是@topic.replies_count还是等于 0