Database
db={locations:[{locationName:"DC",locationCategoryCode:"1"},{locationName:"New York",locationCategoryCode:"1"},{locationName:"Utah",locationCategoryCode:"2"}],locationCategory:[{locationCategoryCode:"1",locationCategoryName:"history"},{locationCategoryCode:"2",locationCategoryName:"nature"}]}
Query
db.locations.aggregate([{$lookup:{from:"locationCategory",localField:"locationCategoryCode",foreignField:"locationCategoryCode",as:"locationCategory"}},{$addFields:{locationCategoryName:{$arrayElemAt:["$locationCategory.locationCategoryName",0]}}},{$project:{locationCategory:0,locationCategoryCode:0}}])