I'm designing a Firestore database for a Facebook-like, social media app and giving the users the option of posting publicly (name included) or anonymously. I had planned on putting all the posts in a top-level collection and using a uid field so users could retrieve and edit their own posts. However, it occurs to be that these uids would be pulled down when users read anonymous posts, so vulnerable to hacking? (e.g., finding non-anonymous posts with the same uids and exposing the user.)
So, now I'm thinking I'll keep the posts as subcollections of the user so that a uid isn't required.
Is my security concern valid? If so, is subcollections the better/best approach?
EDIT: My question is not a duplicate of this question or this question because it's asking about keeping user's anonymity, not editing their data.