[ad_1]
We have built a firestore collection of documents like a javascript map like so…
interface FirestoreAggregateExample {
[key: string]: { otherData }
}
with this map our code works well but I wonder if I am committing any firestore best practice sins where I am creating a collection of documents with infinite fields that Firestore will index. an example doc would be
{
id1: { ...data },
id2: { ...data },
id3: { ...data }
}
and another may look like this
{
id2: { ...data },
id4: { ...data }
}
With this model it looks like Firestore will create an index on every one of these ids. This is not something we need for query purposes and seems to be a result of making our documents like this. Will this cause issues as our database scales to enterprise level and we have millions of these documents with ever increasing field names?
the alternative we’re thinking would be something like this…
{
mappedData: {
id1: { ...data },
id2: { ...data }
}
}
[ad_2]