Preventing Aggregation Pipeline Access to the courses Collection

To maintain service boundaries and ensure proper separation of concerns within our microservice architecture, direct aggregation lookups ($lookup) from the languages context into the courses collection must be avoided.

$lookup: {
  from: 'courses',
  let: { languageId: '$_id' },
  pipeline: [
    { $match: { $expr: { $eq: ['$languageId', '$$languageId'] } } },
    { $match: queryFilter },
  ],
  as: 'courses',
}

…creates a tight coupling between the languages and courses domains by assuming internal schema knowledge and exposing cross-context joins. This breaks the principle of encapsulation and introduces hidden dependencies that make services harder to evolve independently.

DomainProfile
Actionfix
DepartmentBackend

Please authenticate to join the conversation.

Upvoters
Status

Completed

Board
💡

Feature Request

Date

Over 1 year ago

Author

[Deleted User]

Subscribe to request

Get notified by email when there are changes.