title: Meteor collection.update foreach using data from the documents to update
body: <p>I'm learning Meteor (I'm a noob though), and would like to update multiple records in a collection based on the change of one variable.</p>
  
  <p>There are 15 documents in the collection, each have 2 fix values (call it data1 and data2), data3 that is a variable that is periodically changing, and many other fields calculated based on these three parameters.</p>
  
  <p>I know the syntax is terrible, I'd just like to show what I'd like to achieve:</p>
  
  <pre><code>Collection.update(
  {data1: 158000},
  {
  data1: 158000,
  data2: 0.25,
  data3: variable1,
  data4: variable1 - data1,
  data5: data4*data2
  etc...}
  
  Collection.update(
  {data1: 200000},
  {
  data1: 200000,
  data2: 0.5,
  data3: variable1,
  data4: variable1 - data1,
  data5: data4*data2
  etc...}
  
  etc...
  </code></pre>
  
  <p>So basically I'd like to have an update function for each document in the collection, and I need to be able to calculate the values to update to based on the data in each collection and one variable passed to the whole function. Thanks for the help in advance.</p>