public function bucket() : Stage\Bucket
    {
        $stage = new Stage\Bucket($this, $this->dm, $this->class);
        $this->addStage($stage);

        return $stage;
    }
public function bucket() : Stage\Bucket
    {
        $stage = new Stage\Bucket($this, $this->dm, $this->class);
        $this->addStage($stage);

        return $stage;
    }
public function bucket ( ) : Stage \ Bucket { $ stage = new Stage \ Bucket ( $ this , $ this -> dm , $ this -> class ) ; $ this -> addStage ( $ stage ) ; return $ stage ; }
Categorizes incoming documents into groups, called buckets, based on a
specified expression and bucket boundaries.

Each bucket is represented as a document in the output. The document for
each bucket contains an _id field, whose value specifies the inclusive
lower bound of the bucket and a count field that contains the number of
documents in the bucket. The count field is included by default when the
output is not specified.

@see https://docs.mongodb.com/manual/reference/operator/aggregation/bucket/
Categorizes incoming documents into groups called buckets based on a specified expression and bucket boundaries .