Datastore/src/Query/Query.php
public function distinctOn($property)
    {
        if (!is_array($property)) {
            $property = [$property];
        }

        foreach ($property as $prop) {
            $this->query['distinctOn'][] = $this->propertyName($prop);
        }

        return $this;
    }
public function distinctOn($property)
    {
        if (!is_array($property)) {
            $property = [$property];
        }

        foreach ($property as $prop) {
            $this->query['distinctOn'][] = $this->propertyName($prop);
        }

        return $this;
    }
public function distinctOn ( $ property ) { if ( ! is_array ( $ property ) ) { $ property = [ $ property ] ; } foreach ( $ property as $ prop ) { $ this -> query [ 'distinctOn' ] [ ] = $ this -> propertyName ( $ prop ) ; } return $ this ; }
The properties to make distinct.

The query results will contain the first result for each distinct
combination of values for the given properties (if empty, all results
are returned).

Example:
```
$query->distinctOn('lastName');
```

@param array|string $property The property or properties to make distinct.
@return Query
The properties to make distinct .