Uploaded image for project: 'Realm JavaScript SDK'
  1. Realm JavaScript SDK
  2. RJS-233

Inherit base model in other models

      So i read the doc but it didnt help,
      What i have is a base model which has some common fields and i want to inherit those in my all other models.
      My Base Model:

      class Base { }
      
      Base.schema = {
        name: 'Base',
        properties: {
          uuid: { type: 'string', optional: false },
          created_by: { type: 'string', optional: false },
        }
      };
      

      My Other Model:

      class Student { }
      
      Student.schema = {
        name: 'Student',
        properties: {
          name: { type: 'string', optional: false },
          age: { type: 'int', optional: true }
          ...
        }
      };
      

      Result i want when i create a record:

      {
          uuid: 'xxx-xxx-xxx-xxx-xxx'
          created_by: 'xxx-xxx-xxx-xxx-xxx'
          name: 'Smith'
          age: 20
          ...
      }
      

            Assignee:
            Unassigned Unassigned
            Reporter:
            unitosyncbot Unito Sync Bot
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: