Sep 2, 2018 · 1 min read
I guess a good example would be.
Say for instant messaging.
Image a collection of ‘threads’
You might want to have a sub-collection of ‘messages’ in here because this is going to give you a lot more power when it comes to sorting/security rules/limiting/ordering while querying Firestore.
The performance would be so good if you were comparing every single thread for sub key values like ‘thread/{uid}/messages.timeCreated’ would go over threads not just messages.
In this case ‘thread/{uid}/messages.timeCreated’ would use the power of the sub collection. (Sub collection not meaning JUST an object of keys but actually a full document within the document)
Correct me if I sound like a buffoon.
