Method: Mongoid::Criterion::Optional#skip
- Defined in:
- lib/mongoid/criterion/optional.rb
#skip(value = 0) ⇒ Object
Adds a criterion to the Criteria that specifies how many results to skip when returning Documents. This is mostly used in conjunction with limit() to handle paginated results, and is similar to the traditional “offset” parameter.
Options:
value: An Integer specifying the number of results to skip. Defaults to 0.
Example:
criteria.skip(20)
Returns: self
131 132 133 |
# File 'lib/mongoid/criterion/optional.rb', line 131 def skip(value = 0) @options[:skip] = value; self end |