Good evening, I'm studying Firebase with IONIC and Angular (I'm not using AngularFire) and a doubt has arisen. How do I update the data saved in Firebase? To get the data I do it as follows:
const config = {
apiKey: "x",
authDomain: "x",
databaseURL: "x",
projectId: "x",
storageBucket: "x",
messagingSenderId: "x"
};
firebase.initializeApp(config);
let ref = firebase.database().ref('statuspedido');//statuspedido
this.pedidos = new Array();
ref.on('value', (dataSnapshot) =>{
let items = dataSnapshot.val();
for(let dados in items){
this.pedidos.push(
new PedidoModel(
items[dados].dataEmissao,
items[dados].dataAtualizacao,
items[dados].vendedor, items[dados].frete,
items[dados].transportadora, items[dados].status)
)
}
})
My firebase structure looks like this:
AndIwanttoforexampledotheupdateof"idPedido = 1" without changing the others.