title: Realm - Value not convertible to a number
body: <p>Hello community :) I implemented lots of good working functionality with firebase -> realm. Now i tried to edit a structure and I am running through the wildest error messages.</p>
  
  <p><strong>What is right for sure:</strong></p>
  
  <ul>
  <li><strong>Firebase</strong> sends the data</li>
  <li>Data is <strong>Converted</strong> (e.g. Firebase has "brands" as array -> is converted to a string for Realm Schema)</li>
  <li>The error appears when firebase <strong>updates</strong></li>
  <li>Not every firebase content has all fields (e.g. Like you can see out of Realm Schema some fields are <strong>optional</strong>: true)</li>
  </ul>
  
  <p><strong>Fields where i maybe expect an issue:</strong></p>
  
  <ul>
  <li>Maybe its not possible to say that the ReferentList is optional (or i implemented it wrong): See Realm Schema <em>const ReferentsList</em></li>
  </ul>
  
  <p><strong>What i tried</strong></p>
  
  <ul>
  <li>Debug before realm.create (Realm set) Result: Every data came in the right format</li>
  <li>Checked all input values if they are int, string, ...</li>
  </ul>
  
  <p>Hopefully someone can help me here because i got completely stuck with this issue and its necesarry to continue for my project. I want to know:</p>
  
  <ul>
  <li>The solution why or what to do</li>
  <li>A posibility to debug realm in a better way
  <strong>Thank you in advance for your time and help :)</strong></li>
  </ul>
  
  <p><strong>Error message:</strong> <em>Value not convertible to a number</em></p>
  
  <p><strong>Firebase datastructure</strong></p>
  
  <blockquote>
    <ul>
    <li>"begin" : "2017-05-15T15:50:00.000Z",</li>
    <li>"description" : "abc",</li>
    <li>"end" : "2017-05-15T16:15:00.000Z",</li>
    <li>"id" : 6,</li>
    <li>"language" : [ 1 ],</li>
    <li>"location" : "L 1.02",</li>
    <li>"member" : 20,</li>
    <li>"referent" : [ 1, 3 ],</li>
    <li>"register" : true,</li>
    <li>"title" : "Sound of Silence",</li>
    <li>"track" : 6,</li>
    <li>"type" : 3,</li>
    <li>"brands" : [ 1, 2, 3 ]</li>
    </ul>
  </blockquote>
  
  <p><strong>Realm Schema</strong>
  <div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>const ReferentListSchema = {
      name: 'ReferentList',
      properties: {
          id: {
              type: 'int',
              optional: true
          }
      }
  }
  
  const LanguageListSchema = {
      name: 'LanguageList',
      properties: {
          id: 'int'
      }
  }
  
  const EventSchema = {
      name: 'Events',
      primaryKey: 'id',
      properties: {
          id: 'int',
          begin: {
              type: 'date',
              optional: true
          },
          end: {
              type: 'date',
              optional: true
          },
          title: 'string',
          description: 'string',
          register: 'bool',
          member: {
              type: 'int',
              optional: true
          },
          language: {
              type: 'list',
              objectType: 'LanguageList'
          },
          location: 'string',
          referent: {
              type: 'list',
              objectType: 'ReferentList'
          },
          type: 'int',
          track: {
              type: 'int',
              optional: true
          },
          img: {
              type: 'string',
              optional: true
          },
          brands:{
              type: 'string',
              optional: true
          }
      }
  }</code></pre>
  </div>
  </div>
  </p>
  
  <p><strong>Realm set</strong></p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>set(obj) {
    realm.write(() =&gt; {
        if(obj.referent){
            obj.referent = obj.referent.map(function(id) {
                return {id};
            })
        }
        if (obj.language){
            obj.language = obj.language.map(function(id) {
                return {id};
            })
        }
        realm.create('Events', obj, true);
    });
  }</code></pre>
  </div>
  </div>
  </p>