src/League/Monga/Query/Computer.php
public function first($result, $field = null)
    {
        $field = $this->prepareField($field ?: $result);

        $this->fields[$result] = ['$first' => $field];

        return $this;
    }
public function first($result, $field = null)
    {
        $field = $this->prepareField($field ?: $result);

        $this->fields[$result] = ['$first' => $field];

        return $this;
    }
public function first ( $ result , $ field = null ) { $ field = $ this -> prepareField ( $ field ? : $ result ) ; $ this -> fields [ $ result ] = [ '$first' => $ field ] ; return $ this ; }
Aggregate the first value of a set.

@param string $result result key
@param string $field  field to generate get the first from

@return object $this
Aggregate the first value of a set .