I have a table Entries where each document represents a list entry. Among other info, I want to store a set of id's in each document. These id's will be strings. The relevant id's needed will vary between different documents. When these documents are retrieved, the goal is to be able to efficiently display the entries in a React table and filter by the id's each document has, which seems like would make the most sense as a javascript Set.
Example of what I'm thinking of:
{
name: "Bob",
ids: {
"1234a",
"9999b"
}
},
{
name: "Paul",
ids: {
"9999b",
"0000z"
}
}
From reading around, it looks like I could potentially store ids as an Array, and convert them to a Set when retrieved.
Another options seems to be to store ids as a Map, where the key is the id and the value is something arbitrary (like true or something). Example:
{
name: "Paul",
ids: {
"9999b": true,
"0000z": true
}
}
What would be the most performant way to do this?