Skip to content

Instantly share code, notes, and snippets.

@rdsmartins
Created September 6, 2015 14:18
Show Gist options
  • Save rdsmartins/67f62eddea434e5a15d4 to your computer and use it in GitHub Desktop.
Save rdsmartins/67f62eddea434e5a15d4 to your computer and use it in GitHub Desktop.
//https://groups.google.com/forum/#!topic/firebase-talk/_2YQ--nmTzw
/*
Stephan,
As Jacob mentioned, you can use the site name to be the key for your "sites" entries.
When I first started using Firebase, I found myself trying to deal with things like this as well.
I wasn't grasping this because I thought "pushing" to a table was the way to do everything.
When you push, you get that unique ID.
I finally realized that the solution was to use "set" instead of push for many of these cases.
*/
var ref =new Firebase("yourfirebase").child('site 1').set({ item1 : 'hello'});
/*
The only concern with this is with special characters. Firebase can't have keys that have special characters like ".". So, if you were putting email addresses in, you need to use some mechanism to replaces those special characters with a replacement string. Then, you need to remember to query with the replacement string.
http://stackoverflow.com/questions/19350486/how-to-authenticate-escaped-email-based-user-accounts-in-firebase
*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment