我在车辆中有一个租金集合,其中包含字段userid
(是指用户集合)和vehicle_id
(是指车辆集合),另外还有brand_id
(是品牌参考)字段集合),model_id
,type_id
等
我想从租车表中获取记录,其中包括用户集合中的用户名,车辆集合中的车辆名称以及品牌表中的其他所需品牌名称等
return Rentals
.find({ bookedBy: user_id, isCompleted: 'true' })
.populate('bookedBy')
.populate('vehicle_id')
.populate('brand_id')
.then(function (rentals) {}