I am using this js code:
var grade_type = document.getElementById("grade_type").value;
gradesRef.set({
grade_type: firebase.firestore.FieldValue.arrayUnion(grade)
});
But in my cloud firestore the field is going to be named with: 'grade_type'. But I want to name the field like the value of grade_type.
How to do that?