distinct() public method

Finds the distinct values for a specified field across the collection.
public distinct ( string $collectionName, string $fieldName, array | object $filter = [], array $options = [] ) : mixed[]
$collectionName string
$fieldName string Field for which to return distinct values
$filter array | object Query by which to filter documents
$options array Command options
return mixed[]
Example #1
0
 public function distinct($collectionName, $fieldName, $filter = [], array $options = [])
 {
     return $this->bridge->distinct($this->cName($collectionName), $fieldName, $filter, $options);
 }