model issue

main
Ayush Mukherjee 4 years ago
parent 584bdc1863
commit 398eca33e5

@ -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()

Loading…
Cancel
Save