Hello. I have two collections:
Races and Racers
I want to aggregate two collections. I want two join both collections and calculate average speed two teams. I k now that I need to use $lookup and than $group. One problem that I get allways NULL after using $lookup. I use code:
db.getCollection('Racers').aggregate([
{$lookup:{
from:"Races",
localField:"lastname",
foreignField:"lastname",
as:"Time"
}}
])
and I get:
Can anyone explain the problem and how I should solve it? Thank you in advance!