Description
I keep track of certain users by adding them to an array of pointers in the database.
My app is a turn-based game (3 turns exactly, that's why I opted for an array of user pointers as it wouldn't create very long arrays).. Each game keeps track of users playing by adding User Pointers to userHistory. It looks like this:
"userHistory": [
{
"__type": "Pointer",
"className": "_User",
"objectId": "pv54RnXqqj"
},
{
"__type": "Pointer",
"className": "_User",
"objectId": "Xqqpv33Rnj"
}
],`
That part still works fine since the migration.
Problem is when I query on userHistory
. For instance, I want to retrieve all games where a certain user has participated. When previously using Parse, I would simply:
gameQuery.equalTo("userHistory", object); // where object is a pointer to a specific user
And that would work.
Querying for a specific pointer on an array of pointers doesn't seem to work with equalTo()
as it used to.
It's giving me 0 results.
What am I missing?
EDIT
I worked around this for now by storing object ID's and not pointers. No problem with query.equalTo() on array of ids.