robbiblubber.org

help | login | search:  
>>

read  source  history 


avg()


MongoDB Driver Function Reference


Returns the averages for the selected fields.



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



Arguments


<cursor> A result set.
<field> A field name.



Returns


Returns a result set (cursor).



Example


db.employees.find().avg("age");


Selects the average for the age field from the employees collection.






home | MongoDB Driver Function Reference | MongoDB Driver