$lookup
Configures simple join and let/pipeline based LookupSpec, Driver-native raw stage, unwind and lookup count flow.
localField / foreignField
let + pipeline + $expr
• bindConditionFields(leftField, condition, rightField)
• bindConditionFieldsLeftToObjectId(...)
• bindConditionConst, bindConditionBetween, bindConditionLike
• bindConditionExists, bindConditionIsNull, bindConditionIsNotNull
• rawStage(Bson) for Driver-native lookup pipeline stages
• unwind(preserveNullAndEmptyArrays)
• outerStage(Bson) / outerStages(...) for stages after $lookup
Execute Lookup
unwind(...)를 사용하지 않은 기본 findAll lookup은 right 결과를 List<R>로 반환합니다. 단건 left/right가 필요하면 find().executeLookup(...) 경로를 사용합니다.
Lookup + count / exists
executeLookupAndCount(...) returns data and totalCount together in the form of $facet(data, count). The count/exists builder can also receive lookup results as left/right tuples.