-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Subcollection support #7
Comments
Not currently thought about this @alexvandervegt - as I've not used sub-collections in Firestore myself. Can you give an example and how you'd want to use it in firestore? It shouldn't be a huge problem lifting the code from martin's repo and integrating it here. |
Hi @deanc, I like to keep my data together. For example, I have page large landing page which contains about 40 components. Its to big to store it in a firestore array type. Then I use a structure like this:
So blocks is a subcollection of the current page containing all the data about the components used on that specific page. If you are thinking about integrating the code of martin's repo, can you please give me a timeframe for it? Many thanks in advance! |
@alexvandervegt are you sure Martin's code doesn't work? I took a little bit of it and tried it out locally and I have an
You should expand the allBlock and view the parent for each of them as that will allow you to link back to the necessary page node yourself. |
Ended up creating my own source plugin. Thanks for your quick replies though! |
Hi @alexvandervegt - maybe you'd like to contribute back to this repo with a PR to add the feature? |
Its a whole other structure, i will post it to gatsby plugins myself when its finished |
Opening this again. I made a PR, and will leave it here for future users who may want this feature. |
Is subcollection support on your road map?
Like here:
https://www.gatsbyjs.org/packages/@martinreiche/gatsby-firestore/
The text was updated successfully, but these errors were encountered: