Skip to content

[v3] Queries with equalTo() return null #121

Open
@murej

Description

@murej

Hey,

The following code returns null, however I do get a correct response using Firebase Web API.

firestack.database.ref('messages').orderByChild('uid').equalTo('wIRBRv9SdtfO7EUdhqL45tLhkzm2').on('value', (snapshot) => {
  console.log(snapshot.val());
});

Any ideas? Thanks for all the effort, much appreciation here

Edit: Using iOS

Activity

pedro-ribeiro

pedro-ribeiro commented on Nov 9, 2016

@pedro-ribeiro
Contributor

I believe I'm getting this too.

Edit: I'm using android

pedro-ribeiro

pedro-ribeiro commented on Nov 9, 2016

@pedro-ribeiro
Contributor

I believe I fixed it. Please review PR #122

murej

murej commented on Nov 9, 2016

@murej
Author

Wow awesome, thanks for working on it!

Tried it, and I do get this error:
image

pedro-ribeiro

pedro-ribeiro commented on Nov 9, 2016

@pedro-ribeiro
Contributor

I created the PR against the HEAD of master, but I didn't test it there. Maybe there's another issue. I'll have to investigate.

Edit: oh! and once again I've just tested it in android.

auser

auser commented on Nov 9, 2016

@auser
Contributor

Yeah, the : at the end is causing the problem, I think. We currently split on the :, so having that at the end would cause that error. I suppose we'll need to split on the first one and join the rest of the string together?

pedro-ribeiro

pedro-ribeiro commented on Nov 9, 2016

@pedro-ribeiro
Contributor

Not completely sure I understood what you proposed since I'm not familiar with the ios code, but what about changing the equalTo code to conditionally pass the key variable?

equalTo(value, key) {
  // test key parameter here
  return this.query.setFilter('equalTo', value, key);
}

I guess that way it wouldn't have the trailing ':' due to having an undefined entry in the filters array.

auser

auser commented on Nov 9, 2016

@auser
Contributor

Well, it shouldn't actually have a trailing : in the key on iOS anyway... maybe it does in java, just not sure off-hand. Will have to check it...

murej

murej commented on Nov 14, 2016

@murej
Author

Anything I could help with here? Happy to get this forward. Thanks for the effort guys!

murej

murej commented on Nov 16, 2016

@murej
Author

Hey auser (& other contributors),
this issue is fairly crucial for the project I'm working on with my team, so we're thinking of putting a bounty on it. We have the backing for it and would be happy to push the project this way. Any objections?

pedro-ribeiro

pedro-ribeiro commented on Nov 16, 2016

@pedro-ribeiro
Contributor

@murej, can you give #137 a try?

pedro-ribeiro

pedro-ribeiro commented on Nov 17, 2016

@pedro-ribeiro
Contributor

@auser, from what I've seen you have merged both #136 and #137. They do the same thing. imho, one of them should be reverted.

added this to the v3 milestone on Nov 19, 2016
changed the title [-]Queries with equalTo() return null[/-] [+][v3] Queries with equalTo() return null[/+] on Nov 19, 2016

7 remaining items

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @auser@AndrewHenderson@pedro-ribeiro@murej@Salakar

        Issue actions

          [v3] Queries with equalTo() return null · Issue #121 · fullstackreact/react-native-firestack