Empty objects in Realmdb with Reactotron

Asked

Viewed 35 times

1

I’m having problems with Realmdb objects, every query I do it returns but in Reactotron they come empty regardless of what I do with the whole object, it only appears if I dismember attribute by attribute to another object. Has anyone ever had this problem and solved it somehow ? Note: Ja Linkei the remake and the reactotron in the project. Follow image of reactotron and code:

Reactotron: https://i.stack.Imgur.com/Ohn1d.png Code: https://i.stack.Imgur.com/gsNwk.png

Text code:

async getAllMov(){
    try{
        const realm = await getRealm();
        const listaMov = realm.objects(MovSchema.schema.name);

        console.tron.log(listaMov[4]);

        const d = {...listaMov[4]};

        console.tron.log(d);

        let dados = {
            movID: listaMov[4].movID,
            titulo: listaMov[4].titulo,
            descricao: listaMov[4].descricao,
            valor: listaMov[4].valor,
            tipo: listaMov[4].tipo
        }; 

        console.tron.log(dados);


    }catch(e){
        console.tron.log(e.message);
    }
} 
  • The objects created by Realm are not equal to the "traditional" js objects, the fact that they do not appear in the console may be something in the implementation of toString. Probably if you do a simple conversion with JSON.stringfy(d). Another thing, using "..." in some cases does not work because it does not call the getters/setters of the objects of Remal.

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.