I trying to delete specific field in firebase firestore uisng flutter if the user enter one of the serial code is this collection. Here is my collection for example if the user enter rhdrVjVxcnCCj55c Serial 1 should be empty. collection and fields
I treid this but dose not work
CollectionReference sCodes = FirebaseFirestore.instance
.collection('Register New System ( serial code )');
sCodes
.doc('Serial Codes')
.update({_serialCodeController.text: FieldValue.delete()})
.then((value) => print("User's Property Deleted"))
.catchError(
(error) => print("Failed to delete user's property: $error"));