unity3d - Relational Queries In parse.com (Unity) -
i found example in parse.com. have 2 objects : post , comment, in comment objects have collumn: "parent" pointer post obj , want join them:
var query = parseobject.getquery ("comment"); // include post data each comment query = query.include("parent"); query.findasync().continuewith(t => { ienumerable<parseobject> comments = t.result; // comments contains last ten comments, , "post" field // contains object has been fetched. example: foreach (var comment in comments) { // not require network access. string o= comment.get<string>("content"); debug.log(o); try { string post = comment.get<parseobject>("parent").get<string>("title"); debug.log(post); } catch (exception ex) { debug.log(ex); } } });
it worked! , then, have 2 objects: user , gamescore, in gamescore objects have collumn: "playername" pointer post obj want join them too:
var query = parseobject.getquery ("gamescore"); query.include ("playername"); query.findasync ().continuewith (t =>{ ienumerable<parseobject> result = t.result; foreach (var item in result) { debug.log("list score: "); int score = item.get<int>("score"); debug.log(score); try { var obj = item.get<parseuser>("playername"); string name = obj.get<string>("profile"); //string name = item.get<parseuser>("playername").get<string>("profile"); debug.log(name); } catch (exception ex) { debug.log(ex); } } });
but isn't working, please me!
why didn't following did first example:
query = query.include ("playername");
you have -
query.include ("playername");
Comments
Post a Comment