我需要从mongoDB集合中选择不同的值。正如文档here中所描述的那样,可以使用“distinct”。但它只返回在不同条件下使用的字段(ArrayIterator对象),而不是可记录的游标对象:
object(Doctrine\MongoDB\ArrayIterator)[1072]
private 'elements' =>
array (size=2)
0 => int 39
1 => int 47
private 'commandResult' =>
array (size=3)
'values' =>
array (size=2)
0 => int 39
1 => int 47
'stats' =>
array (size=5)
'n' => int 60
'nscanned' => int 71
'nscannedObjects' => int 71
'timems' => int 0
'cursor' => string 'BasicCursor' (length=11)
'ok' => float 1