Is it possible to assign a custom ID in Firebase when using the POST method? For example:
{
"users": {
"user_one": {
"username": "jdoe",
"password": "123"
}
}
}
I'm currently working on a Vue.js project and I want to save information about students and their parents like this:
let parent = {
name: this.parent.name,
surname: this.parent.surname,
id_number: this.parent.id_number,
nationality: this.parent.nationality,
marital_status: this.parent.marital_status,
education_level: this.parent.education_level,
profession: this.parent.profession,
works: this.parent.works,
work_location: this.parent.work_location,
work_days: this.parent.work_days,
work_phone: this.parent.work_phone,
home_phone: this.parent.home_phone,
mobile_phone: this.parent.mobile_phone
}
axios.post('https://projectname.firebaseio.com/parents.json', parent)
.then(function (response) {
console.log(response);
})
.catch(function (error) {
console.log(error);
});