Pushing an object to an array AngularFire2

0

I have a database in which I would like the data to be saved as follows:

Books:

  • {Object that pusheo}
  • {Object that pusheo} ...
  • That is to say, to treat it as if we were talking about an array in order to be able to go through these elements within my application and make the appropriate operations.

    The problem is that they are being saved in the following way:

    As you can see, you are saving it with the push id of when I execute the instruction:

    let book_data = {
      id: bookId,
      name: bookData.name,
      author: bookData.author,
      genre: bookData.genre,
      publishDate: bookData.publishDate
    };
    this.fb.list('my-lists/${bookList.name}/books/').push(bookData);
    

    What am I doing wrong to push the object and save it as an array?

        
    asked by Carlos Martel Lamas 11.04.2018 в 12:59
    source

    0 answers