title: Compute first order derivative with MongoDB aggregation framework
body: <p>Is it possible to calculate a first order derivative using the aggregate framework?</p>
  
  <p>For example, I have the data : </p>
  
  <pre><code>{time_series : [10,20,40,70,110]}
  </code></pre>
  
  <p>I'm trying to obtain an output like: </p>
  
  <pre><code>{derivative : [10,20,30,40]}
  </code></pre>