Chris
 · Dedicated Learner

Moving a separate collection to a subcollection of another collection

Resolved

Hello everyone! I realized I may have made a mistake in structuring my backend. I created most of my collections (most importantly posts, comments and users) as completely separate collections.

The app works fine for now, but I am assuming that this will lead to scalability issues as well as extra documents in my database that referenced deleted documents (ie a comment document exisitng but a post having been deleted). Before my app scales, should I take the time to make these into subcollections? And is there an easy way to do this? I understand I would have to migrate existing documents and that would be time consuming but I would like to know if this is worth it.

Thanks all!!

2 replies