slice() public méthode

Returns a subset of an array.
See also: https://docs.mongodb.org/manual/reference/operator/aggregation/slice/
Since: 1.3
public slice ( mixed | self $array, mixed | self $n, mixed | self | null $position = null )
$array mixed | self
$n mixed | self
$position mixed | self | null
Exemple #1
0
 /**
  * Returns a subset of an array.
  *
  * @see https://docs.mongodb.org/manual/reference/operator/aggregation/slice/
  * @see Expr::slice
  * @param mixed|Expr $array
  * @param mixed|Expr $n
  * @param mixed|Expr|null $position
  * @return self
  *
  * @since 1.3
  */
 public function slice($array, $n, $position = null)
 {
     $this->expr->slice($array, $n, $position);
     return $this;
 }