robbiblubber.org

help | login | search:  
>>

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


desc()


MongoDB Driver Function Reference


Sorts a result set descending by the fields specified.



<cursor>.desc(<field>[,...])



Arguments


<cursor> A result set (like returned by find()).
<field> A field name.



Returns


Returns a result set (cursor).



Example


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


Orders all employees descending by age, then by salary.






home | MongoDB Driver Function Reference | MongoDB Driver