From 398eca33e58cc62968bb717507733e7b6e7adcaf Mon Sep 17 00:00:00 2001 From: Ayush Mukherjee Date: Sun, 14 Mar 2021 05:52:32 +0530 Subject: [PATCH] model issue --- src/ws/crud.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/ws/crud.js b/src/ws/crud.js index 702e9a4..397e1fc 100644 --- a/src/ws/crud.js +++ b/src/ws/crud.js @@ -85,7 +85,11 @@ const matchFns = { const streamFns = { getAll: async () => { - return await streams.find().populate('event').populate('matches matches.orange matches.blue').populate('casters').populate('hosts').exec() + return await streams.find().populate('event').populate({ + path: 'matches', + populate: { path: 'orange' }, + populate: { path: 'blue' }, + }).populate('casters').populate('hosts').exec() }, getById: async (id) => { return await streams.findById(id).populate('event').populate('matches').populate('casters').populate('hosts').exec()