How to access the attributes of an array of pointers on parse.com

0

I have the following problem I can currently get the [object Object] of each order, however I need to access its attributes and try the include function but I can not access it send me undefined

link

I leave my code and hope you can help me thank you very much

exports.pedido = function (req,res){
var currentUser = req.session.user;
    if (currentUser){
        var query_restaurante = new Parse.Query(Restaurante),
                query_historial = new Parse.Query(Historial),
                query_ordenes = new Parse.Query(Orden);
        var restaurante;
        query_restaurante.include("encargado");
        query_restaurante.equalTo("encargado", {__type: "Pointer",className: "_User",objectId: currentUser.objectId});
        query_restaurante.first().then(function(restaurante_encontrado){
            restaurante = restaurante_encontrado;
            query_historial.include("usuario");
            query_historial.include("orden");
            query_historial.equalTo("restaurantes", restaurante);
            return query_historial.find();
            console.log(query_historial)
        }).then(function(historiales){
        var context = {
                title: "Menu",
                restaurante: restaurante,
                historial: historiales,
                logo_restaurante: restaurante.get("logo"),
                rating : restaurante.get("rating"),
                suspender : restaurante.get("suspender"),
                publicidad : restaurante.get("publicidad"),
        };
        return context;
    }).then(function(context){
        res.render('pedidos',context);
        return res;
    }, function(error) {
        console.log("Error " + error.code + ": " + error.message);
        res.redirect('/');
    });
}else{
        res.redirect('/');
}

}

    
asked by Angel 27.09.2016 в 17:28
source

1 answer

0

I'm not an expert on parse.com

The first thing you should do is a console.log(JSON.stringify(restaurante_encontrado)) to see what attributes you have and how to access them. Maybe it's something as simple as restaurante.atributo_deseado

greetings

    
answered by 28.09.2016 в 20:01