I’m in the processes of modeling a MongoDB database which will be used to live query people depending on specs like their facial features ( hair color, skin tone ), body features ( size, height ), etc
For organizational purposes, I’m thinking about nesting those properties in groups as described above, e.g.:
{
id: 42424
username: John_Doe
face : {
hair_color: blonde;
skin_tone: white;
},
body : {
weight: 100lbs;
size: 5'7;
}
}
Performance-wise, would this be a good model if I know that the operator will often search depending on nested categories like face.hair_color and body.size ?
Or is retrieving nested values much slower ?