f-miyu / Plugin.CloudFirestore

MIT License
121 stars 44 forks source link

Is there a way to get the size of a collection? #20

Closed Jorvan758 closed 4 years ago

Jorvan758 commented 4 years ago

I think this plugin is awesome, but I don't know if it can do this

If you know a way, I would thank you to share it

Jorvan758 commented 4 years ago

Better yet, is there a way to know if a document exists?

Jorvan758 commented 4 years ago

Nevermind. Solving this, I learned about try and catch 👍🏽

JHHMobile commented 4 years ago

Can you share it?

Jorvan758 commented 4 years ago

I don't have access to my project right now, but it's just like:

try
    {
    open_Firestore_document();
    }
catch(NullReferenceException e)
    {
    inform_that_can't_open_Firestore_document();
    }

Also, in case it helps: https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/keywords/try-catch