From de4ab6f39532930edf09daf0fae8b43f992e6cbf Mon Sep 17 00:00:00 2001 From: Ayush Mukherjee Date: Wed, 24 Mar 2021 19:49:04 +0530 Subject: [PATCH] fix: populate blue and orange roster data from match --- src/ws/crud.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/ws/crud.js b/src/ws/crud.js index 671d057..65339aa 100644 --- a/src/ws/crud.js +++ b/src/ws/crud.js @@ -94,7 +94,10 @@ const streamFns = { }).populate('casters').populate('hosts').exec() }, getById: async (id) => { - return await streams.findById(id).populate('event').populate('matches').populate('casters').populate('hosts').exec() + return await streams.findById(id).populate('event').populate({ + path: 'matches', + populate: [{ path: 'orange' }, { path: 'blue' }], + }).populate('casters').populate('hosts').exec() }, update: async(id, data) => { return await streams.findByIdAndUpdate(id, data).exec()