I am wondering how to do the following- I have the following data:
dta = {
\"fielddata\": {
\"text1\": \"4B030C2E-3D53-4DF8-A3535EF377B45DE5\",
getter
exports.getDeep = function(field, object){
var parts = field.split('.');
var value = object;
// Iterate the parts, updating value each time
for( var i = 0; i < parts.length; i++ ){
value = value[parts[i]];
if(i==parts.length-1){
return JSON.parse(JSON.stringify(value))
}
}
}
setter
exports.setDeep = function(field, object, newvalue){
var parts = field.split('.');
for( var i = 0; i < parts.length; i++ ){
if(i==parts.length-1){
object[parts[i]] = newvalue
return object
}
}
}