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















show wiki  show source  compare to current  compare to previous  read  history 


orderBy()


MongoDB Driver Function Reference

orderBy sorts a result set by the fields specified.



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



Arguments


<cursor> A result set (like returned by find())
<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


Returns a cursor (result set).



Example


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


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






home | MongoDB Driver Function Reference | MongoDB Driver