Query.prototype.slice()

Parameters
  • [path] «String»
  • val «Number» number/range of elements to slice
Returns:
  • «Query» this

Specifies a $slice projection for an array.

Example

  1. query.slice('comments', 5)
  2. query.slice('comments', -5)
  3. query.slice('comments', [10, 5])
  4. query.where('comments').slice(5)
  5. query.where('comments').slice([-10, 5])