Realm.js: Storing unstructured object as property
<p>We have a content delivery app, where we bring down objects on our JSON that are dynamic in structure. React Native consumes the JSON, and builds up the user interface from these objects. </p>

<p>This is the schema that I'm working with now: </p>

<pre><code>const CardSchema = {
    name: 'Card',
    properties: {
        id: 'string',
        cardSubType: 'string',
        cardType: 'string',
        state: 'string',
        contentType: 'string',
        context: {},
    },
};
</code></pre>

<p>The field <code>context</code> is the dynamic part. It's basically an object that can have any number of fields. We don't know at compile time which fields are in there. </p>

<p>We would like to use realm.js to persist our data, because it's nice and fast and 99% of our objects we can module at compile time. </p>

<p>It's just this one field (and a few others) that we want to store any object on. </p>

<p>Is this possible with Realm for React Native? Or would I need to model it as a string and do serialization when I store and deserialization when I load? </p>