You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
⭐️ This challenge is up for grabs! Claim it by clicking "assign yourself" on the right, under the "Assignees" section for this GitHub issue! You can work on this by yourself or in pairs.
✔️ To complete this challenge: Post a comment at the bottom of this page with some instructions and sample code, so the rest of our team can learn how to use this new Firebase property by reading your comment!
You can edit your comment at any point to update your answer, so you don't have to do these all at once! To edit your comment after you publish it, click the pencil icon in the top right corner of your comment:
❓ If you have any questions, please post a comment at the bottom of this page! (You can also ask us on Slack, but please post a comment here too so we can more easily reference it later.)
Every database Reference object in Firebase has a key, except for the root of the database.
Your challenge
🏆 The goal: learn how this property works, test it out for yourself, and then post a comment at the bottom of this page with some instructions and sample code to help teach the rest of our team!
Questions to keep in mind:
What does the official documentation say about this property ?
When would we need to use this property ? What are some example use cases? (Write some sample code for us, please!)
When should we not use this property ? Can you think of any scenarios where using this property would cause errors or unintended side effects?
What data types can be stored as values of this property?
The text was updated successfully, but these errors were encountered:
The key can be null or non-null
The key is used for accessing data at the end of the path.
You can find it by accessing the last item after the last "/"
for example,
var dbRef = firebase.database().ref("path/key");
Here, your key would be "key";
If you have no key (ie the reference is null),
it would look like :
Great start @kammitama5! Try refining this description and the example code some more when you have a chance -- right now your example isn't actually use the keyproperty. For example, see the sample code in the official documentation:
// The key of any non-root reference is the last token in the pathvaradaRef=firebase.database().ref("users/ada");varkey=adaRef.key;// key === "ada"key=adaRef.child("name/last").key;// key === "last"
So the key property is used in adaRef.key to get the key (or path) of that database location, which is the string "ada" in this case.
⭐️ This challenge is up for grabs! Claim it by clicking "assign yourself" on the right, under the "Assignees" section for this GitHub issue! You can work on this by yourself or in pairs.
✔️ To complete this challenge: Post a comment at the bottom of this page with some instructions and sample code, so the rest of our team can learn how to use this new Firebase property by reading your comment!
You can edit your comment at any point to update your answer, so you don't have to do these all at once! To edit your comment after you publish it, click the pencil icon in the top right corner of your comment:
![github-edit-comments](https://user-images.githubusercontent.com/1555022/27059741-06de4e70-4f8d-11e7-9076-53de602e5c6a.png)
❓ If you have any questions, please post a comment at the bottom of this page! (You can also ask us on Slack, but please post a comment here too so we can more easily reference it later.)
About the Firebase
key
property📚 Official documentation: Firebase API section on the
key
propertyEvery database Reference object in Firebase has a
key
, except for the root of the database.Your challenge
🏆 The goal: learn how this property works, test it out for yourself, and then post a comment at the bottom of this page with some instructions and sample code to help teach the rest of our team!
Questions to keep in mind:
The text was updated successfully, but these errors were encountered: