public function distinct($tableSpecId, $fieldName, array $filter=[])
    {
        $t = new \Tripod\Timer();
        $t->start();

        $filter['_id.'._ID_TYPE] = $tableSpecId;

        $collection = $this->config->getCollectionForTable($this->storeName, $tableSpecId, $this->readPreference);
        $results = $collection->distinct($fieldName, $filter);

        $t->stop();
        $query = array('distinct'=>$fieldName, 'filter'=>$filter);
        $this->timingLog(MONGO_TABLE_ROWS_DISTINCT, array('duration'=>$t->result(), 'query'=>$query, 'collection'=>TABLE_ROWS_COLLECTION));
        $this->getStat()->timer(MONGO_TABLE_ROWS_DISTINCT.".$tableSpecId",$t->result());
        return array(
            "head"=>array(
                "count"=>count($results)
            ),
            "results"=>$results
        );
    }
public function distinct($tableSpecId, $fieldName, array $filter=[])
    {
        $t = new \Tripod\Timer();
        $t->start();

        $filter['_id.'._ID_TYPE] = $tableSpecId;

        $collection = $this->config->getCollectionForTable($this->storeName, $tableSpecId, $this->readPreference);
        $results = $collection->distinct($fieldName, $filter);

        $t->stop();
        $query = array('distinct'=>$fieldName, 'filter'=>$filter);
        $this->timingLog(MONGO_TABLE_ROWS_DISTINCT, array('duration'=>$t->result(), 'query'=>$query, 'collection'=>TABLE_ROWS_COLLECTION));
        $this->getStat()->timer(MONGO_TABLE_ROWS_DISTINCT.".$tableSpecId",$t->result());
        return array(
            "head"=>array(
                "count"=>count($results)
            ),
            "results"=>$results
        );
    }
public function distinct ( $ tableSpecId , $ fieldName , array $ filter = [ ] ) { $ t = new \ Tripod \ Timer ( ) ; $ t -> start ( ) ; $ filter [ '_id.' . _ID_TYPE ] = $ tableSpecId ; $ collection = $ this -> config -> getCollectionForTable ( $ this -> storeName , $ tableSpecId , $ this -> readPreference ) ; $ results = $ collection -> distinct ( $ fieldName , $ filter ) ; $ t -> stop ( ) ; $ query = array ( 'distinct' => $ fieldName , 'filter' => $ filter ) ; $ this -> timingLog ( MONGO_TABLE_ROWS_DISTINCT , array ( 'duration' => $ t -> result ( ) , 'query' => $ query , 'collection' => TABLE_ROWS_COLLECTION ) ) ; $ this -> getStat ( ) -> timer ( MONGO_TABLE_ROWS_DISTINCT . ".$tableSpecId" , $ t -> result ( ) ) ; return array ( "head" => array ( "count" => count ( $ results ) ) , "results" => $ results ) ; }
Returns the distinct values for a table column, optionally filtered by query

@param string $tableSpecId
@param string $fieldName
@param array $filter
@return array
Returns the distinct values for a table column optionally filtered by query