|
update : 2015.11.03
php.shukuma.com검색:
|
MongoCollection::distinct(PECL mongo >=1.2.11) MongoCollection::distinct — Retrieve a list of distinct values for the given key across a collection. 설명
public array MongoCollection::distinct
( string
$key
[, array $query
] )The distinct command returns a list of distinct values for the given key across a collection. 인수
반환값
Returns an array of distinct values, 실패 시 예제Example #1 MongoCollection::distinct() example
<?php위 예제의 출력:
array(2) {
[0]=>
int(10010)
[1]=>
int(99701)
}
array(1) {
[0]=>
int(10010)
}
array(2) {
[0]=>
int(10010)
[1]=>
int(99701)
}
Example #2 MongoCollection::distinct() example on a embedded document
<?php위 예제의 출력:
array(2) {
[0]=>
int(25)
[1]=>
int(31)
}
array(0) {
}
|