Wix Code: Retrieving and comparing data from specific fields in my database collection

@ishaanpat
You can use Dataset’s method onAfterSave to register a callback which will be executed when user submits data. This callback will receive the item that was submitted to collection and you can perform your comparison there. More information and code samples about onAfterSave can be found here
Let me know if you need further assistance. Good luck!