Calculate min, max and average from a mongodb collection
<p>I have to calculate Min, Max and Average values from a MongoDB collection and insert those values into another collection in the same DB.</p>

<p>It has to be done automatically each 15 min, 1 hour and 1 day.</p>

<p>I was wondering if I could use a JavaScript function stored in MongoDB but I don't know how to call that function automatically at a specific time ?</p>

<p>Thanks for the help !</p>