Database

db={"parks":[{"_id":{"$binary":{"base64":"5y1dpNaZSEOTJiace1Ta2A==","subType":"04"}},"parkID":"9c98c8ee-17a6-4db7-8115-c55fa470480d"}],"city":[{"_id":{"$binary":{"base64":"nJjI7hemTbeBFcVfpHBIDQ==","subType":"04"}},"name":"Bellaire"}]}

Query

db.parks.aggregate([{"$lookup":{"from":"city","let":{"parkID":"$parkID"},"pipeline":[{"$set":{"uuid":{"$function":{"body":"function(id) {return id.hex()}","args":["$_id"],"lang":"js"}}}},{"$set":{"uuid":{"$concat":[{"$substrCP":["$uuid",0,8]},"-",{"$substrCP":["$uuid",8,4]},"-",{"$substrCP":["$uuid",12,4]},"-",{"$substrCP":["$uuid",16,4]},"-",{"$substrCP":["$uuid",20,12]}]}}}],"as":"city_park_details"}}])

Result