querying

One of MongoDB's greatest features is its ability to execute dynamic queries, which Mongoid abstracts in a familiar Arel-style DSL.

mongoid queries

All queries in Mongoid are Criteria, which is a chainable and lazily evaluated wrapper to a MongoDB dynamic query. Criteria only touch the database when they need to, for example on iteration of the results, and when executed wrap a cursor in order to keep memory management and performance predictable.