Angularfire: Remove $key and $value on calls to set

Created on 29 Jun 2016  路  6Comments  路  Source: angular/angularfire

We're adding these properties to objects returned from firebase, but if someone modifies these objects and then calls set the set call will fail because these are invalid properties in a firebase object.
I think we should automatically remove these properties if they're present in a set call since they aren't valid firebase keys anyways.

Firebase(List | Object) bug

Most helpful comment

Hi, i think you should also remove the $exists too.

All 6 comments

I wondered if I am doing something wrong because of this.

related to #190 and #197

Interesting, I believe the Firebase SDK behavior prior to 3 was to just ignore the properties.

@jeffbcross It was. It looks like the new behavior is to throw an error whenever a key has an invalid character.

To be technically correct, the old behavior was to ignore any properties that _begin with_ $ or _. Other invalid keys (for example, a key containing a #, ., $, et al) would still throw an error.

Hi, i think you should also remove the $exists too.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

mypark picture mypark  路  3Comments

StephenFluin picture StephenFluin  路  3Comments

adriandurran picture adriandurran  路  3Comments

jnupeter picture jnupeter  路  3Comments

itisparas picture itisparas  路  3Comments