ruby-on-rails,mongoid,mongoid3,counter-cache
Looks like you just have a namespace problem. If you look at the error closely: undefined method ... for Mongoid::Persistence::Atomic::Operation:Module you'll see that it is complaining about not being able to find reset_counters in Mongoid::Persistence::Atomic::Operation, not Operation. And if you look at the 3.1.6 source, you'll find Operation in lib/mongoid/persistence/atomic/operation.rb....
ruby-on-rails,ruby-on-rails-4,increment,counter-cache
For your purpose, I think that you should use an attribute like :counter_cache in AR association. For example: class Comment < ActiveRecord::Base # cached value will stored into the comments_count column at posts table belongs_to :post, counter_cache: true end class Post < ActiveRecord::Base has_many :comments end Rails will do a...