Database
db={"entries":[{"_id":"5fc2765938401a2308e18ac5","options":[{"name":"First Option","_id":"5fc2765938401a2308e18ac6",},{"name":"Second Option","_id":"5fc2765938401a2308e18are",},{"name":"Third Option","_id":"5fc2765938401a2308e18aef",}],},{"_id":"5fc2766438401a2308e18ac8","options":[{"name":"Some other option","_id":"5fc2766438401a2308e18ac9",},{"_id":"5fc2766438401a2308e18aca","name":"This is also an option"}],}],"votes":[{"_id":"5fc2765938401a2308e18ac5","entryId":"5fc2765938401a2308e18ac6"},{"_id":"5fc2765938401a2308e18aer","entryId":"5fc2765938401a2308e18are"},{"_id":"5fc2765938401a2308e18ek","entryId":"5fc2765938401a2308e18ac6"}]}
Query
db.entries.aggregate([{$lookup:{from:"votes",localField:"options._id",foreignField:"entryId",as:"votes"}},{$project:{options:{$map:{input:"$options",as:"a",in:{$mergeObjects:["$$a",{votes:{$size:{$filter:{input:"$votes",cond:{$eq:["$$this.entryId","$$a._id"]}}}}}]}}}}}])