Skip to content

Commit

Permalink
fix: ora anche i lecturers hanno il
Browse files Browse the repository at this point in the history
  • Loading branch information
aziis98 committed Oct 27, 2023
1 parent a10bb85 commit d85d896
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions server/controllers/public/courses.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,25 @@ const EventPhdCourse = require('../../models/EventPhdCourse')

async function coursesQuery(req) {
const pipeline = [
{$unwind: '$lessons'},
{$lookup: {
{ $unwind: '$lessons'},
{ $lookup: {
from: 'conferencerooms',
localField: 'lessons.conferenceRoom',
as: 'lessons.conferenceRoom',
foreignField: '_id'
}},
{ $lookup: {
from: 'people',
localField: 'lecturers',
foreignField: '_id',
as: 'lecturers',
}},
{ $project: {
_id: 1,
speaker: 1,
lecturers: 1,
lecturers: {
firstName: 1,
lastName: 1,
},
title: 1,
lessons: {
date: 1,
Expand Down

0 comments on commit d85d896

Please sign in to comment.