Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can't Post data containing $ in a key to Firebase

Tags:

firebase

I'm attempting to post some data into Firebase (relative part of the URL is /messages.json). The following request content:

{"gsx$enddate":"sometime"}

Gives the following error:

Invalid data; couldn't parse JSON object, array, or value. Perhaps you're using invalid characters in your key names.

This is valid JSON however. What am I doing wrong?

like image 941
Brian C Avatar asked Dec 01 '22 17:12

Brian C


1 Answers

It's supposed to be a valid JSON but it seems like it's a limitation for FireBase

From FireBase Documentation:

Character Set Limitations

Note that URLs used to construct Firebase references may contain any unicode characters except:

  • . (period)
  • $ (dollar sign)
  • [ (left square bracket)
  • ] (right square bracket)
  • # (hash or pound sign)
  • / (forward slash)
like image 99
meda Avatar answered Dec 15 '22 17:12

meda