Skip to content
This repository was archived by the owner on May 19, 2025. It is now read-only.

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
Contributor

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 subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants