title: React Native realm get objects return array without values
body: <p>Realm react native returning array of objects without values.</p>
  <p>package version in <code>package.json</code></p>
  <pre><code>&quot;react&quot;: &quot;16.11.0&quot;,
  &quot;react-native&quot;: &quot;0.62.2&quot;,
  &quot;realm&quot;: &quot;^6.0.2&quot;
  </code></pre>
  <p>node version : <code>v12.17.0</code></p>
  <p>react-native-cli: <code>2.0.1</code></p>
  <p>Defined <code>Students</code> class and schema as below:</p>
  <pre><code>export class Students {}
  
  Students.schema = {
    name: 'students',
    primaryKey: 'roll_no',
    properties: {
      name: {type: 'string'},
      roll_no: {type: 'string'},
      order: {type: 'int', default: 0},
    },
  };
  </code></pre>
  <p>Creating realm database object globally:</p>
  <pre><code>export const realmDatabase = new Realm({
    schema: [Students],
    path: 'school.realm',
    schemaVersion: 1,
  });
  </code></pre>
  <p>Using below function to insert data into <code>student</code> table</p>
  <pre><code>export function insertStudents(students) {
      realmDatabase.write(() =&gt; {
        students.forEach((student) =&gt; {
          try {
            realmDatabase.create('students', {
              name: student['name'],
              order: student['order'],
              roll_no: student['roll_no'],
            });
          } catch (error) {}
        });
      });
  }
  </code></pre>
  <p>Fetch students from database using below function, but it retrieving empty Array of objects</p>
  <pre><code>export function getStudents() {
    try {
      let students = realmDatabase.objects('students');
      console.log(students);
    } catch (error) {}
  }
  </code></pre>
  <p>Output :</p>
  <pre><code>{ '0': {},
    '1': {},
    '2': {},
    '3': {},
    '4': {},
    '5': {},
    '6': {}}
  </code></pre>