Hi,
I created a type:
function GameType(args)
{
args = args || {};
this.type = args[“type”] || “”;
this.name = args[“name”] || “”;
};
I create and saved an object:
var gameType = new GameType({type : “Roulette”, name : “Standard Roulette”});
Backendless.Persistence.of(GameType).save(
gameType,
new Backendless.Async(
function(obj)
{
console.log("Object save: " + obj);
doNextFn(fns, err);
},
function(err)
{
console.log("error message - " + err.message);
console.log("error code - " + err.statusCode);
}
)
);
An export of the table as CSV shows this:
“name(STRING)”,“created(DATETIME)”,“updated(DATETIME)”,“ownerId(STRING)”,“objectId(STRING_ID)”,“type(STRING)”
“Standard Roulette”,“06/15/2015 00:00:00 GMT+0000”,null,“C9A09D32-CD05-78A7-FF8A-2A0B1229C300”,“98243FF5-C1E2-7404-FFC8-4A1614082E00”,“Roulette”
I try and get it with findById (and find and findFirst, they all have the same problem):
Backendless.Persistence.of(GameType).findById(
“5EFA2F26-9689-DE31-FF54-4B42EE641500”,
new Backendless.Async(
function(ret)
{
console.log(JSON.stringify(ret));
},
function(err)
{
console.log("error message - " + err.message);
console.log("error code - " + err.statusCode);
}
)
);
I get this:
{“0”:"{",“1”:""",“2”:“m”,“3”:“e”,“4”:“s”,“5”:“s”,“6”:“a”,“7”:“g”,“8”:“e”,“9”:""",“10”:":",“11”:""",“12”:“E”,“13”:“n”,“14”:“t”,“15”:“i”,“16”:“t”,“17”:“y”,“18”:" “,“19”:“w”,“20”:“i”,“21”:“t”,“22”:“h”,“23”:” “,“24”:“t”,“25”:“h”,“26”:“e”,“27”:” “,“28”:“s”,“29”:“p”,“30”:“e”,“31”:“c”,“32”:“i”,“33”:“f”,“34”:“i”,“35”:“e”,“36”:“d”,“37”:” “,“38”:“I”,“39”:“D”,“40”:” “,“41”:“c”,“42”:“a”,“43”:“n”,“44”:“n”,“45”:“o”,“46”:“t”,“47”:” “,“48”:“b”,“49”:“e”,“50”:” “,“51”:“f”,“52”:“o”,“53”:“u”,“54”:“n”,“55”:“d”,“56”:”:",“57”:" “,“58”:“I”,“59”:“d”,“60”:” “,“61”:”-",“62”:" “,“63”:“5”,“64”:“E”,“65”:“F”,“66”:“A”,“67”:“2”,“68”:“F”,“69”:“2”,“70”:“6”,“71”:”-",“72”:“9”,“73”:“6”,“74”:“8”,“75”:“9”,“76”:"-",“77”:“D”,“78”:“E”,“79”:“3”,“80”:“1”,“81”:"-",“82”:“F”,“83”:“F”,“84”:“5”,“85”:“4”,“86”:"-",“87”:“4”,“88”:“B”,“89”:“4”,“90”:“2”,“91”:“E”,“92”:“E”,“93”:“6”,“94”:“4”,“95”:“1”,“96”:“5”,“97”:“0”,“98”:“0”,“99”:""",“100”:",",“101”:""",“102”:“c”,“103”:“o”,“104”:“d”,“105”:“e”,“106”:""",“107”:":",“108”:“1”,“109”:“0”,“110”:“0”,“111”:“0”,“112”:"}",“type”:"",“name”:""}
I can’t access ret.data, ret.totalObjects, nothing!!!
Any ideas, or what stupid thing am I doing??