Skip to content

Commit

Permalink
mongoclient distinct 'where'.
Browse files Browse the repository at this point in the history
  • Loading branch information
kakserpom committed Nov 21, 2011
1 parent 9ce8a70 commit 85a07ee
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion app-clients/MongoClient.php
Expand Up @@ -560,7 +560,7 @@ public function evaluate($code, $callback, $key = '') {


/** /**
* Returns distinct values of the property * Returns distinct values of the property
* @param array Hash of properties (offset, limit, opts, key, col) * @param array Hash of properties (offset, limit, opts, key, col, where)
* @param mixed Callback called when response received * @param mixed Callback called when response received
* @param string Optional. Distribution key * @param string Optional. Distribution key
* @return void * @return void
Expand Down Expand Up @@ -592,6 +592,10 @@ public function distinct($p, $callback, $key = '') {
'distinct' => $e[1], 'distinct' => $e[1],
'key' => $p['key'], 'key' => $p['key'],
); );

if (isset($p['where'])) {
$query['query'] = $p['where'];
}


$packet = pack('V', $p['opts']) $packet = pack('V', $p['opts'])
. $e[0] . '.$cmd' . "\x00" . $e[0] . '.$cmd' . "\x00"
Expand Down

0 comments on commit 85a07ee

Please sign in to comment.