I want to create a database model for posts like the above image.
posts(collection) > categories(document) > c1(collection) > post_id(document) > post_data
In that case if I perform any queries like whereEqualTo
or whereLessThan
on c1
collection it works fine.
But in the other case,
posts(collection) > all(document) > post_id(collection) > post_data
In that case I want to perform queries on all
, but I can't because it's a document.
So is there any ways to add a subcollection to a collection without adding document or adding a dummy document/collection like following is the only way to do it?
posts(collection) > all(document) > xyz(collection) > post_id(document) > post_data
Need help :(