I have a large data set that's structured like this:
[
Person1: { Mid: 0, Support: 0, Jungle: 0, Top: 0, Bot: 0 },
Person2: { Mid: 0, Support: 0, Jungle: 0, Top: 0, Bot: 0 },
Person3: { Mid: 0, Support: 0, Jungle: 0, Top: 0, Bot: 0 },
]
My schema looks something like this:
const rankSchema = new Schema(
{
rank: Schema.Types.Mixed,
lastUpdated: { type: Date, default: Date.now() },
},
{ minimize: false }
);
I have also tried:
{
rank: [],
lastUpdated: { type: Date, default: Date.now() },
},
// and also
{
rank: { type: Schema.Types.Mixed },
lastUpdated: { type: Date, default: Date.now() },
},
But nothing I do seems to be working. I am starting to think that storing information like this is not possible so what would be the best way to structure my data so that I won't have to loop through the entire array to find a specific person.
Edit: For clarification, I am trying to store that entire data set in the "rank" value of the schema.
[{Person1:{..}},{Person2:{..}},...]