title: Meteor Store input in a Collection
body: <p>I'm new in meteor js programming and my intent is collect input from a form of radio button for multiple answer inside a collection Answers.
  The problem now is that if I click on the submit button I see the answers optvalue in the Url tab but if I open the console in Chrome and digit Answers.find().fetch() there are not items inside the collection.</p>
  
  <p>My project view is :</p>
  
  <pre><code>-project
  --client
  ------main.js
  ------main.html
  ------main.css
  --imports
  ---api
  ------answers.js
  ---ui
  ------body.js
  ------body.html
  --server
  ------main.js
  </code></pre>
  
  <p>client/main.js</p>
  
  <pre><code>import '../imports/api/answers.js';
  import '../imports/ui/body.js';
  </code></pre>
  
  <p>imports/api/answer.js</p>
  
  <pre><code>import { Mongo } from 'meteor/mongo';
  
  Answers = new Mongo.Collection('answers');
  
  Answers.allow({
      insert(){return false;},
      update(){return false;},
      remove(){return false;},
  });
  
  Answers.deny({
      insert(){return true;},
      update(){return true;},
      remove(){return true;},
  });
  </code></pre>
  
  <p>imports/ui/body.html</p>
  
  <pre><code>&lt;body&gt;
    &lt;div class="container"&gt;
      &lt;header&gt;
        &lt;h1&gt;Questionnaire&lt;/h1&gt;
      &lt;/header&gt;
      {{&gt; questionnaire}}
    &lt;/div&gt;
  &lt;/body&gt;
  
  &lt;template name="questionnaire"&gt;
      &lt;form&gt; 
          {{#each questions}}
          &lt;fieldset&gt;
              &lt;legend&gt;{{qtitle}}&lt;/legend&gt;
              &lt;p&gt;{{qtext}}&lt;/p&gt;
              {{#each options}}
                  &lt;p&gt;&lt;input type="radio" name="{{this.optqgroup}}" value="{{this.optvalue}}" required&gt;  {{this.optxt}}&lt;/p&gt;
              {{/each}}
          &lt;/fieldset&gt;
          &lt;br&gt;
          {{/each}}
  
          &lt;input type="submit" value="Submit your answers"&gt;
    &lt;/form&gt;
  &lt;/template&gt;
  </code></pre>
  
  <p>imports/ui/body.js</p>
  
  <pre><code>import { Template } from 'meteor/templating';
  
  import './body.html';
  
  Template.questionnaire.events({
      'submit form': function(event,template) {
          questions.forEach(function(question) { 
              let selected = event.target[question.optgroup].value;
              Meteor.call('insertAnswer', selected, (error)=&gt; {
                  if(error){
                      console.log(error);
                  }
              })
          });
      }
  });
  
  
  Template.body.helpers({
  questions : [
    { 
      qtitle: "1. Title Q1", 
      qtext: "Text Q1", 
      options:[
          {optgroup:"q1", 
           optvalue: "q1_opt1", 
           opttxt: "Option 1"},
          {optgroup:"q1", 
           optvalue: "q1_opt2", 
           opttxt: "Option 2"}]},
      {
      qtitle: "2. Title Q2", 
      qtext: "Text Q2",
      options:[
          {optgroup:"q2", 
           optvalue: "q2_opt1", 
           opttxt: "Option 1"},
          {optgroup:"q2", 
           optvalue: "q2_opt2", 
           opttxt: "Option 2"},]}]});
  </code></pre>
  
  <p>server/main.js</p>
  
  <pre><code>import '../imports/api/answers.js';
  
  
  Meteor.methods({
      insertAnswer(selected){
          Answers.insert({
                  selected:selected
          });
      }
  });
  </code></pre>
  
  <p>Can you please help me to fix this problem?</p>