Database
db={"locationObject":[{"location":{"type":"Point","coordinates":[6.0517125,52.5275644],},"_id":1,},{"location":{"type":"Point","coordinates":[6.0517383,52.5275477],},"_id":2,},{"location":{"type":"Point","coordinates":[6.0517681,52.5275179],},"_id":3,},],"Rating":[{"_id":1,"locationObject":1,"average":4.3},{"_id":2,"locationObject":1,"average":2.3},{"_id":3,"locationObject":1,"average":1.3},{"_id":4,"locationObject":2,"average":4.3},{"_id":5,"locationObject":2,"average":5.0},]}
Query
db.locationObject.aggregate([{"$match":{"location":{"$geoWithin":{"$centerSphere":[[6.064953,52.531348],0.0012]}}}},{"$lookup":{"from":"Rating","localField":"_id","foreignField":"locationObject","as":"locRatings"}},{$unwind:{"path":"$locRatings","preserveNullAndEmptyArrays":true}},{"$group":{"_id":"$_id","field":{"$avg":"$locRatings.average"},"totalItemCount":{"$sum":1.0},"locations":{"$addToSet":"$location"}}}])