title: How to use spark and mongo with play to calculate prediction?
body: <p>I am using play, scala and mongodb (salat).</p>
  
  <p>I have following database structure-</p>
  
  <pre><code>[{
  "id":mongoId,
  "name":"abc",
  "utilization":20,
  "timestamp":1416668402352
  },
  {
  "id":mongoId,
  "name":"abc",
  "utilization":30,
  "timestamp":1415684102290
  },
  {
  "id":mongoId,
  "name":"abc",
  "utilization":90,
  "timestamp":1415684402210
  },
  {
  "id":mongoId,
  "name":"abc",
  "utilization":40,
  "timestamp":1415684702188
  },
  {
  "id":mongoId,
  "name":"abc",
  "utilization":35,
  "timestamp":1415684702780
  }]
  </code></pre>
  
  <p>By using above data, I want to calculate utilization for current timestamp (By applying statistical algorithm).</p>
  
  <p>To calculate it I am using spark. I have added following dependencies to build.sbt of play framework.</p>
  
  <p>I have following questions.</p>
  
  <p>1) How to calculate current utilization?? (using MLlib of spark)</p>
  
  <p>2) Is it possible to query mongo collection to get some of fields using spark??</p>