is there a way to set a custom ID in Firebase when using the POST method? something like:
{
"users": {
"user_one": {
"username": "jdoe",
"password": "123"
}
}
}
I'm working on a Vue.js project and trying to save some students and their parents like:
let padre = {
nombre: this.padre.nombre,
apellido: this.padre.apellido,
cedula: this.padre.cedula,
nacionalidad: this.padre.nacionalidad,
estado_civil: this.padre.estado_civil,
instruccion: this.padre.instruccion,
profesion: this.padre.profesion,
trabaja: this.padre.trabaja,
l_trabajo: this.padre.l_trabajo,
d_trabajo: this.padre.d_trabajo,
tlf_trabajo: this.padre.tlf_trabajo,
tlf_habitacion: this.padre.tlf_habitacion,
tlf_movil: this.padre.tlf_movil
}
axios.post('https://projectname.firebaseio.com/padres.json', padre)
.then(function (response) {
console.log(response);
})
.catch(function (error) {
console.log(error);
});