| |
read source history
= distinct() =
----
[[MongoDB Driver Function Reference]]
Returns a distinct version of the input result set.
[[[@cG
<cursor>.distinct([<field>[,...]])
]]]
**Arguments**
[[[@w
|@t0@r0@c0 <cursor> | | A result set. |
| <field> | | A field name. |
]]]
**Returns**
[[[@w
Returns a result set (cursor).
]]]
**Example**
[[[@cw
db.employees.find().select(age).distinct();
]]]
Returns a distinct list of ages in the //employee// collection.
----
[[Main|home]] | [[MongoDB Driver Function Reference]] | [[MongoDB Driver]]
|