Skip to content

Query on Pointer Array Issue #74

Closed
@edvincandon

Description

@edvincandon

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    type:bugImpaired feature or lacking behavior that is likely assumed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions