我有一个 MongoDB 查询
Job.aggregate([
{$match: {created_by: req.params.userId }},
{$lookup: {
from: "users",
localField: "applicant._id",
foreignField: "_id",
as: "applicant" }},
{$unwind: '$applicant'}
])
当applicant._id为空时,它将无法工作。这不是我想要的,如何使$lookup可选?