What is `alreadyHasObj` in mongo query planner

Hi Team, I am evaluating query performances in Mongodb with different data models for one of our use cases; when I check the explain query, I can see different stages of my query, and I can see a lot of information about the each stage. But I could not find any documentation for the fields except totalDocsExamined and totalKeysExamined.
what I am curious in 3rd stage of my query planner I am seeing “docsExamined” : 144, “alreadyHasObj” : 144. can I get any information or links about each field explanation in explain results.

Hello @Kiran_Sunkari,

Check out this documentation,

This is the latest documentation, you can change the version from the top left dropdown, whatever you are using.

Thanks for the documentation link. It contains a majority of information, but it still does not have information about “alreadyHasObj”. I am getting this value in one of the execution stages. My query has three stages. 3rd stage is a logical condition ( $and, $or). For the first and second stages contains alreadyHasObjas zero. But the third-stage is showing alreadyHasObj=144. Is it indicating some antipattern in the data mode.?

Can you please share more details:

  • Version of MongoDB that you are using
  • Your query
  • Explain result