python-firebase icon indicating copy to clipboard operation
python-firebase copied to clipboard

Storing data with period

Open wontonst opened this issue 9 years ago • 4 comments

How would I ever go about storing any data with a period?

firebase.put('/',".", {'print':'silent'})
firebase.put('/',"""{"test":"."}""", {'print': 'silent'})
firebase.put('/test',".", {'print': 'silent'})

All of these will result in a 400 Client Error.

wontonst avatar Feb 28 '16 07:02 wontonst

Ok so I figured out that we can do

firebase.put('/',"blah", {'test':'.'},)

But I cannot store in the root using

firebase.put('/',"", {'test':'.'},)

wontonst avatar Feb 28 '16 07:02 wontonst

After more digging around, it turns out erroring out is correct, but it would be great to have a nicer error message. I also edited the README in pull #59 to make post/put look more intuitive since I didn't read the entire readme and got confused/wasted a lot of time.

wontonst avatar Feb 28 '16 07:02 wontonst

%2E is valid, however using this as a key appears to cause a 400 error to be thrown. I am still trying to track it down, but it looks like it might be an issue with the underlying library (requests). Maybe someone with more python experience could offer some insight?

firebase.put('/test',"foo%2Ebar", {'print': 'silent'})

egreenmachine avatar Apr 30 '16 21:04 egreenmachine

Firebase does not allow keys to contain a "."

The list of forbidden characters for keys is:

. (period) $ (dollar sign) [ (left square bracket) ] (right square bracket) # (hash or pound sign) / (forward slash) (space)

darrelfrancis avatar Jul 29 '21 16:07 darrelfrancis