Instead of:
{
A: [el_1, el_2, etc.]
}
I want to create this schema:
{
A: {
el_1: true,
el_2: true,
etc...
}
}
The reason is because in order to find if el_x
is $in
A, if it is an array, the time complexity is O(N).
However, as I understand it, the time complexity to find a key value pair is either O(1) or O(logN).
Can someone confirm this? Can someone confirm this?