I know that findOne is constant time when using it in the following way:
collection.findOne(aString)
However, I can't seem to find out if it's still constant time when querying an indexed field that isn't _id
. For example, I have a collection that's mirroring an external API. In this collection, there's a separate id
field that's indexed.
My question is, is collection.findOne({ id: anId })
still constant time?