Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Should allow an equalTo query with a 'null' value so that the client … #136

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

johnlim
Copy link

@johnlim johnlim commented Oct 25, 2016

…is able to query for data that does not have a specific key.

I believe there should a more elegant solution but this works and we have a test in place.

…is able to query for data that does not have a specific key.
@JGSolutions
Copy link

@johnlim
How do you use this equal-to attribute? I pass a value and i get undefined

@johnlim
Copy link
Author

johnlim commented Jun 30, 2017

@JGSolutions like this:

   <firebase-query
      id="query"
      path="[[path]]"
      data="{{data}}"
      app-name="appName"
      equal-to="null"
      equal-to-null>
    </firebase-query>

@tjmonsi
Copy link
Collaborator

tjmonsi commented Sep 21, 2017

This might have bad side effects where a particular value in the database would have a string "null" (which I don't know why they would do that but it will happen)

But having another flag called equal-to-null might be hackish in a sense that it is not really part of the firebase doc spec.

I don't know if it is possible to have it this way

<firebase-query
      id="query"
      path="[[path]]"
      data="{{data}}"
      app-name="appName"
      equal-to="[[equalTo]]">
    </firebase-query>

and have it equalTo = null then wrap around a checker that checks if it is undefined to not set equalTo

@merlinnot
Copy link
Contributor

According to the official docs it’s perfectly fine pass null as a value. However there’s a strict comparison to null here: https://github.com/firebase/polymerfire/blob/f1073078115b72280984d5d9b1c88d75f510fc9a/firebase-query.html#L263

It was introduced in #98 as a fix to #59 by @mbleigh

It seems to me that the comparison should be made against undefined.

I’ll try to make a PR for this in the coming days.

@jared-unify
Copy link

This would be helpful. Can this be merged now?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants