I have a Mongoose schema in NestJS like such:
...
@Prop()
casinoAmount: number;
@Prop()
gameHyperLink: string;
@Prop()
casinoHyperLink: string;
@Prop({ type: Types.ObjectId, ref: 'Game' })
games: Game[];
}
I want to make a query, that makes a full " left join". Basically a query that select each Provider with all elements from the corresponding games.
If i do a regular query (without populate) it will simple return all the ObjectID's
const providers = await this.providerRepository
.find({})
.skip(offset)
.limit(limit)
.exec();
However when i populate like such
const providers = await this.providerRepository
.find({})
.populate('games')
.skip(offset)
.limit(limit)
.exec();
However, it only returns a single game object and not a list of all the objects.
Does anybody know why this occurs?

