Search Firestore for existing record

Hi,

How do check if a record exists in the Firestore DB, in this case (Admission Number). The action I want is as follows.

If button is pressed (check if any document has the same Admission Number) as the one in the TextField. If no record is found, create a document. If there is a simalar Admission Number, do not create the document. See image below.

Thanks

1
7 replies