E.g:
class Foo; include Mongoid::Document; has_and_belongs_to_many :bars;end class Bar; include Mongoid::Document; end f = Foo.create! f.bar_ids => [] f.bars => []
All good, but in the log for the last command I see:
MONGODB blah_development['bars'].find({:_id=>{"$in"=>[]}})
Could just save the db hit by noticing bar_ids is empty..?