что linkingObjects делает в real-native?и как я могу получить к нему доступ и войти в консоль? - PullRequest
0 голосов
/ 27 июня 2019

У меня есть приведенный ниже код, и я не понимаю, как получить доступ к объектам linkingOb.это какие-то данные, которые прикрепляются автоматически?Я просто не понимаю, что это на самом деле?потому что я не могу получить доступ к его значению.

          name: 'Person',
          properties: {
              name:'string',
              dogs: 'Dog[]'
          }
      }

      const DogSchema = {
          name:'Dog',
          properties: {
              name:'string',
              // No shorthand syntax for linkingObjects properties
              owners: {type: 'linkingObjects', objectType: 'Person', property: 'dogs'}
          }
      }
schema: [DogSchema, PersonSchema]
              }).then(realm => {

                realm.write(() => {


                    const barker=realm.create('Dog',{
                        name:'barker'
                    })

                   const ash=realm.create('Person',{
                       name:'ash',
                       dogs:[barker]
                   })

                    ash.dogs.push({name:'badDog'})





                    realm.objects("Person").map(person=>{
                        console.log(person )//no worker data
                    })


                });
                this.setState({ realm });
...