title: Meteor & Mongo: addToSet inserting
body: <p>I have some documents in my base:</p>
  
  <pre><code>//example docs
  {"_id": "qwerty12345", "name": "Bob", "cards":["cardId1", "cardId2", "cardId3"]}
  </code></pre>
  
  <p>I'm using this for inserting data:</p>
  
  <pre><code>Template.insert.events({
      'click add': function(){
          if(confirm("Add card?"));
          mycollection.update({_id: Session.get('fooId')}, { $addToSet: { cards: this._id}})
  
      }
  });
  </code></pre>
  
  <p>Then i'm using this helper for my template:</p>
  
  <pre><code>Template.index.helpers({
    cards: function(){
          query = mycollection.findOne({_id: Session.get('fooId')});
          return query.cards;
      }
  });
  </code></pre>
  
  <p>And in template:</p>
  
  <pre><code>&lt;img src="{{img}}" class="add"&gt;
  {{#each cards}}
  {{this}}&lt;br&gt;
  {{/each}}
  </code></pre>
  
  <p>This works perfecty, but i have a trouble:</p>
  
  <p>As you see, every image have id and url({{image}}), i'm need to add image url to 'mycollection' too for every card(on click).</p>
  
  <p>How to make it?</p>
  
  <p>And the second problem:
  How to allow mongo insert duplicates to "cards" array?</p>