robbiblubber.org

help | login | search:  
>>

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


asc()


MongoDB Driver Function Reference

Sorts a result set ascending by the fields specified.



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



Arguments


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



Returns


Returns a cursor (result set).



Example


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


Orders all employees ascending by age, then by salary.







home | MongoDB Driver Function Reference | MongoDB Driver