We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent a7b6f54 commit b7f2bdeCopy full SHA for b7f2bde
server/controllers/processes/visits.js
@@ -174,10 +174,23 @@ const GET_PIPELINE = [
174
foreignField: '_id',
175
as: 'referencePeople',
176
pipeline: [
177
+ { $lookup: {
178
+ from: 'institutions',
179
+ localField: 'affiliations',
180
+ foreignField: '_id',
181
+ as: 'affiliations',
182
+ pipeline: [
183
+ { $project: {
184
+ _id: 1,
185
+ name: 1,
186
+ }},
187
+ ]
188
189
{ $project: {
190
_id: 1,
191
firstName: 1,
192
lastName: 1,
193
+ affiliations: 1,
194
email: 1,
195
}},
196
]
0 commit comments