| |
read source history
= avg() =
----
[[MongoDB Driver Function Reference]]
Returns the averages for the selected fields.
[[[@cG
<cursor>.avg([<field>[,...]])
]]]
**Arguments**
[[[@w
|@t0@r0@c0 <cursor> | | A result set. |
| <field> | | A field name. |
]]]
**Returns**
[[[@w
Returns a result set (cursor).
]]]
**Example**
[[[@cw
db.employees.find().avg("age");
]]]
Selects the average for the age field from the //employees// collection.
----
[[Main|home]] | [[MongoDB Driver Function Reference]] | [[MongoDB Driver]]
|