So far I have the following code, I get an object and with a for what I'm going through:
for (var i = 0; i < data.length; i++) {
console.log("datos completos -> " + data[i].id_expediente);
//acceder a mis datos de firebase
this.db.collection("usuarios").doc(this.user.nombre_actuario)
.set({
[data[i].id_expediente] : JSON.stringify(data[i])
})
.then(function() {})
.catch(function(error) {
console.log(error);
});
}
The problem is that only saves the last data in firebase, Any idea why the problem?