I am creating one of my firsts webs that I intend to launch to the real world using JAMstack with Firestore. I am running into this problem and haven't been able to figure it out after doing days of research. This line is overwritting the data because even when the form camps remain unfilled, they get null values that get pushed to the database. How can I push only the non-null values?
const formData = new FormData(userform);
const image = formData.get('userimage')
const description = formData.get('userdescription')
const facebook = formData.get('facebook')
const instagram = formData.get('instagram')
const twitter = formData.get('twitter')
db.collection('users').doc(firebaseUser.uid).set({description, image, facebook, instagram, twitter},{merge : true});