A more accurate answer: MongoDB uses B-Tree indexes. Finding a specific value in a B-Tree has O (log n) complexity in the average and worst case, which can be considered quite fast (i.e. Binary search). This is not constant complexity = O (1), although you can still have some slowdown effects if the index size becomes larger than the available RAM. (MongoDB tries to store indexes in RAM, and every IO needed to find an index on disk will significantly slow down your query).
Mario source share