HI I have some code to get a json value from my db and then add it to an object but in my if cycle it has the value  {"isRoot": "true", "visible": "true"} but after the cycle i do a console.log to this and get undefined...
Database.Services.getServicesMapInfoById(device.id).then(function(mapData){
        if(mapData!=undefined){
            var map = mapData.map;
            console.log("sendDeviceInfo map  >>>>>>>>>>>>>>>>>>>>> ", map);
            sendData.map=map;
            resolve(sendData);
        } else {
            resolve(null);
        }
    }).catch(function (e) {
        createLog('error', __dirname, __filename.slice(__dirname.length + 1, -3), device.id, 'sendDeviceInfo','FATAL',e);
        return reject(e);
    });
console.log("sendDeviceInfo map --------------------------------->", sendData.map);
Logs:
sendDeviceInfo getServicesMapInfoById map  >>>>>>>>>>>>>>>>>>>>> {"isRoot": "true", "visible": "true"}
sendDeviceInfo map ---------------------------------> undefined
Can anyone help me? I'm returning the value of map with Promises using resolve but this didn't solve my problem...
