| |
read source history
= desc() =
----
[[MongoDB Driver Function Reference]]
Sorts a result set descending by the fields specified.
[[[@cG
<cursor>.desc(<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().desc(age, salary);
]]]
Orders all employees descending by age, then by salary.
----
[[Main|home]] | [[MongoDB Driver Function Reference]] | [[MongoDB Driver]]
|