| |
read source history
= select() =
----
[[MongoDB Driver Function Reference]]
Selects the fields specified into a result set.
[[[@cG
<cursor>.select([<field>[,...]])
]]]
**Arguments**
[[[@w
|@t0@r0@c0 <cursor> | | A result set. |
| <field> | | A field name. |
]]]
Field names may - but need not - be quoted. If asterisk is passed for fields or if fields are omitted, all fields will be selected.
**Returns**
[[[@w
Returns a result set (cursor).
]]]
**Example**
[[[@cw
db.employees.find().select("name", "firstname", "age");
]]]
Selects name, firstname and age fields from the //employees// collection.
----
[[Main|home]] | [[MongoDB Driver Function Reference]] | [[MongoDB Driver]]
|