How to check if the Flutter realm has existing data

I want to add a button to sync my MongoDB realm data, so I want to check if existing data is available in the realm instance, and I want to disable automatic sync when the internet is available.