I am having an issue with a parse query that works sometimes but not always and I believe it is down to the $select portion of the code. I have debugged the results coming back from parse and sometimes it includes all the data I expect but sometimes it misses out the data from the $select. I have even tried to hardcode the objectId in the $select and it does not work still.
I have a class called Data that holds my game and round data. The game row has a type of 'G' and the round data has a type of 'R'. Each round 'R' row has a gameObjectId column that relates to the 'G' row.
The part that gets the G row always returns the correct results and if I hard code a gameObjectid (instead of the $select) it always works
has anyone experienced this kind of issue before? Im 99% sure what I have done in my query is correct but it's not behaving as expected. If some one could check to see if I have done something obvious that would be great?
Tearing my hair out at the moment as my app has just gone live..
In JSON, the following two queries (stripped to the minimum) should return the exact same result but the second one is not consistent:
{"$or":[{"objectId":"TnY7YAKUm4","type":"G"},{"gameObjectId":"TnY7YAKUm4","type":"R"}]}
{"$or":[{"objectId":"TnY7YAKUm4","type":"G"},{"gameObjectId":{"$select":{"key":"objectId","query":{"where":{"objectId":"TnY7YAKUm4","type":"G"},"className":"Data"}}},"type":"R"}]}
My query as an LUA table (for corona) is set as follows:
local queryTable =
{
["where"] =
{ ["$or"] =
{
{
["type"] = "G",
["$or"] = {
{["host"] = settings.userID},
{["opponent"] = settings.userID}
}
},
{
["type"] = "R",
["gameObjectId"] =
{ ["$select"] =
{
["query"] =
{
["className"] = "Data",
["where"] =
{
--["objectId"] = "TnY7YAKUm4"
["type"] = "G",
["$or"] = {
{["host"] = settings.userID},
{["opponent"] = settings.userID}
}
}
},
["key"] = "objectId"
}
}
}
},
},
["limit"] = 1000,
["order"] = "type,localId,updatedAt"
}