Currently in my project I am pushing the object to firebase in a specific ref:
this.CoursesList = this.mydb.database.ref('/courses/' + this.CourseCategoryForm);
this.CoursesList.push(this.course);
this.Reference();
But I want to push it somewhere else at the same time. I read that it was not possible to multipush in Firebase so I wrote the function Reference that would push the course depending on its status.
Reference(){
if(this.CourseStatusDecision == 0){
this.CoursesList = this.mydb.database.ref('/availableCourses/' + this.CourseCategoryForm);
}else{
this.CoursesList = this.mydb.database.ref('/currentSemester/');
}
this.CoursesList.set();
}
My question is I don't want to push the entire object again in another ref (and it usually pushes with a different key, is that because .push() itself creates a key automatically?), I just want the key of the course I just pushed and set it in the other reference, is that possible? And how? Thank you.