Lets say I have a firebase and I want to add Book and Chapter objects to the root node to look like this.
example: {
books: {
book_id: {//book object}
}
chapters: {
chapter_id: {//chapter object}
}
}
The specific problem I am having is how do I have a blank chapters reference without objects underneath it. Like the following
example: {
books: {
book_id: {//book object}
}
chapters: {
//this has no objects underneath it
}
}
You cannot just leave it blank in firebase or the chapters reference will disappear. I thought maybe I could just add a .keep or something to the chapters reference, but that did not work either. Also, if I delete all of the chapter objects from underneath the chapters reference it deletes the chapters reference.
The main reason I want to have these blank references is so that I can delete all of the objects from a certain reference, but then keep the reference in firebase so I can write more objects to it. So if there is another way of accomplishing that using firebase/emberFire it would be nice to know.