What is the time complexity to find the value of a property of a field that is an object

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?

I am specifically referring to an object stored in a MongoDB database. So how does MongoDB implement it?