You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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:
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.
Activity
edvincandon commentedon Jan 30, 2016
Weird, it seems to work when my array
userHistoryof user pointers only has 1 entry.It seems the equalTo behaviour isn't iterating through the array?
gfosco commentedon Jan 30, 2016
Looks like we specifically tested the 1 entry scenario: https://github.com/ParsePlatform/parse-server/blob/master/spec/ParseQuery.spec.js#L2059
But we'll have to add a test for multiple and then fix it.
accept server url env var