Im working with React, I’ve created some data from scratch for it, the data is currently stored locally, but id like to store it on firestore and retrieve it from there. This is my first time trying this.
I have a page with 6 categories displayed, when i go inside each category, the related items are displayed on a separate page. (some items belong to multiple categories).
my current structure is this:
export const plants = [
{
id:1,
name:orchid,
price:23
}
… and so on
export const categories = [
{
name: indoor,
plantId:[1,15,23,14],
image: “https://…….”,
}{
name: outdoor,
plantId: [2,3,8,36],
image: “https://…….”,
}] and so on …
MY question is, how do i restructure the data so firestore can read it and i can retrieve it, or if the current set up is fine.
I have tried to just upload plants data and keep categories data locally, since its small, but separating it and trying to connect categories with its related plants data from firestore got a little confusing for me.
Shay Asanova is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.