There is no way to remove an item at an index and then update all subsequent indexes in one operation. You will have to:
- Read the entire parent node into your application code.
- Remove the item from the array in your application code.
- Write the entire array back to the database.
And if other users may be manipulating the array at the same time, you’ll have to do this using a transaction to prevent the updates from conflicting with each other.
To find out more about a better way to deal with lists of data in Firebase, I recommend reading the documentation on appending items to a list of data and the blog post Best Practices: Arrays in Firebase.
I did some digging, I cant do it the way I wanted. I realized it thanks to Frank’s answer.
I did it this way to find index of each item:
console.log(child.ref_.path.pieces_); // This will return mentioned [index] from database
So I have this code:
This removes etc.  and all data connected to that index in database (it doesn’t matter which number exactly).
When I remove that index how do I update all other indexes to start from 0.
   
  
I want this:
  
thank you for your answer! I was trying to make my code more simple. But there is no way to do it then. I wanted to use index of array and compare it to the index in database.
The simplest way to not have to deal with this is to not use sequential numerical/array indices, but use Firebase