I have a list of products in my Android app which looks like this:
productList
|-- productName_1
|-- parameter_1
|-- parameter_2
|-- parameter_3
|-- productName_2
|-- parameter_1
|-- parameter_2
|-- parameter_3
|-- productName_3
|-- parameter_1
|-- parameter_2
|-- parameter_3
The product names are user generated. I thougth it's a good way to store data, but it appears that there is a name limitation in Firebase (perhaps i missed it in the docs).
When user types "." (dot) i get an exception like this:
com.google.firebase.database.DatabaseException: Invalid Firebase Database path: productList/CoolProduct.. Firebase Database paths must not contain '.', '#', '$', '[', or ']'
Ok. Pretty understandable.
But how to handle this in code and not limit users in product names? Something like escaping sequences or something?
Or perhaps i need to change the scheme and store products under push IDs?