polymerfire
polymerfire copied to clipboard
Should allow an equalTo query with a 'null' value so that the client …
…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.
@johnlim How do you use this equal-to attribute? I pass a value and i get undefined
@JGSolutions like this:
<firebase-query
id="query"
path="[[path]]"
data="{{data}}"
app-name="appName"
equal-to="null"
equal-to-null>
</firebase-query>
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
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.
This would be helpful. Can this be merged now?