robbiblubber.org

help | login | search:  
<<

Home Page
Index

Projects

Utility Suite
Data Suite
Bad Wolf Suite
WeakWiki

User Docs

ConfigNotepad
LED
rqoon
Nuub

Code Docs

.NET
Java
PHP

robbiblubber.org

Specs
Articles

Sources















read  source  history 


= orderBy() =
----
[[MongoDB Driver Function Reference]]


Sorts a result set by the fields specified.


[[[@cG

<cursor>.orderBy(<field>[ asc|desc][,...])

]]]


**Arguments**

[[[@w

|@t0@r0@c0 <cursor> | | A result set. |
| <field> | | A field name. |
| asc | | Sorts the result ascending set by the given field. |
| desc | | Sorts the result desscending set by the given field. |

]]]


**Returns**

[[[@w

Returns a result set (cursor).

]]]


**Example**

[[[@cw

db.employees.find().select().orderBy("age" asc, "salary" desc);

]]]

Orders all employees ascending by age, then descending by salary.




----
[[Main|home]] | [[MongoDB Driver Function Reference]] | [[MongoDB Driver]]