Advertisement
Guest User

Untitled

a guest
Feb 20th, 2019
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.86 KB | None | 0 0
  1. realm = new Realm({
  2. path: 'DeviceDB.realm',
  3. schema: [
  4. {
  5. name: 'Schedule',
  6. primaryKey: 'id',
  7. properties: {
  8. id: 'int',
  9. startingTime: 'string',
  10. endingTime: 'string'
  11. },
  12. },
  13. {
  14. name: 'user_devices',
  15. primaryKey: 'id',
  16. properties: {
  17. id: 'int',
  18. schedules: 'Schedule[]',
  19. dev_name: 'string',
  20. dev_serial: 'string'
  21. },
  22. },
  23. ],
  24. });
  25.  
  26. const devs = realm.objects('user_devices').filtered('id =' + this.state.deviceId);
  27. const fetched_schedules = devs.schedules;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement