Mongoid permits operators to be called on symbols for convenience, e.g.:
(byebug) MyModel.any_of(:field.lte => 'x') #<Mongoid::Criteria selector: {"field"=>{"$lte"=>"x"}} options: {} class: MyModel embedded: false>
There are implemented operators that use different names from the MongoDB's ones to avoid conflicts with Ruby methods, which are type and size:
(byebug) MyModel.any_of(:field.type => 'x') *** NoMethodError Exception: undefined method `type' for :field:Symbol nil (byebug) MyModel.any_of(:field.with_type => 'x') #<Mongoid::Criteria selector: {"field"=>{"$type"=>"x"}} options: {} class: MyModel embedded: false> (byebug) MyModel.any_of(:field.size => 1) *** NoMethodError Exception: undefined method `__expr_part__' for 5:Integer Did you mean? __expand_complex__ nil (byebug) MyModel.any_of(:field.with_size => 1) #<Mongoid::Criteria selector: {"field"=>{"$size"=>1}} options: {} class: MyModel embedded: false>
The deviations should be documented.
The symbol operators which are supported aren't documented either, this should also be done - the list of operators in the server is https://docs.mongodb.com/manual/reference/operator/query/