I am playing around with Firebase Firestore for my data needs. I have a data model where there is a collection of apples, each document representing a unique apple which has a field of type object which is essentially a map of <string, string>
Think of each apple document like:
name: "SiberianApple",
weight: "400g"
color: {
today: "green",
yesterday: "red",
tomorrow: "crimson"
}
Reading through the docs, I understood that we can query collections in various ways, but is it possible to limit the amount of information a client needs to fetch while fetching a document. Can I have a query on this field color
such that it only returns
name: "SiberianApple",
weight: "400g",
color: {
today: "green"
}
Basically something like graphql, where I can ask for what I want. Wanted to know if it's possible to query or should this field be a subcollection of this document so that I can query colors using path apples/<appleId>/colors
for the subCollection?