Cannot add node to Firebase through console

17,319

The Firebase Database is a key-value store. It stores the values of keys at paths in the tree. But it only stores keys when they have an actual value. If there is no value for a key/path, it is immediately deleted.

So if you click the + button, then enter a key and click the Add button, it will delete the first key that you entered because it doesn't have a value.

What you instead should do depends on what you want to accomplish.

To add a single key/value pair:

  • click the +
  • enter a key/Name
  • enter a Value
  • click Add

If you want to add a JSON snippet/tree:

  • click the +
  • enter a key/Name
  • click the + next to the (empty) Value
  • enter a key/Name for the child
  • enter a Value for the child
  • click Add
Share:
17,319

Related videos on Youtube

marciokoko
Author by

marciokoko

100% iOS developer

Updated on December 21, 2020

Comments

  • marciokoko
    marciokoko over 3 years

    I have a Firebase project with 2 mobile apps:

    1. FriendlyChat example from Firebase/Google (messages) - created first
    2. Grocery Items list (grocery-items) - trying to create second

    You can see the messages node already there with some test messages inside.

    enter image description here

    But when I try to add a child to the appId node, I give it a name "grocery-items" and I click on ADD, but the node does not get added. It just disappears.

    Why can't I add the grocery-items node?

  • marciokoko
    marciokoko almost 8 years
    Thanks, I missed that!
  • Claytronicon
    Claytronicon over 6 years
    Also, if you are unable to add items because you are blocked by "read-only" mode, you can just navigate to a url with the new node you want to add, and it will create the node for you. But as stated, you need to also add a value. "Navigate to the new prop that you want to add at the appropriate level. E.g. console.firebase.google.com/project/myapp-xxxxx/database/dat‌​a/… would create a new object prop3 at the root level and from there you can edit data at will." credit: medium.com/@justintulk/…