79743738

Date: 2025-08-22 18:31:57
Score: 1.5
Natty:
Report link

The statement from author is right. The _id is not a compound index, it's a mere exact index.
The high voted answer is misleading and talking about the right things without matching the original question

_id: {
entityAId
entityBId
}

to be able to query entityAId , or query and sort on entityAid and entityBid,
you ll need to create a compound index at _id.entityAid and _id.entityBid

Reasons:
  • No code block (0.5):
  • Low reputation (1):
Posted by: Shuyu Wang