Join condition : array onto multiple recordset

Given two different set of records:

{ “shopid”:“1”, “shopcodes”:[“a”,“c”] }
{ “shopid”:“2”, “shopcodes”:[“b”] }

{ “shopcode”:“a”, shopcodedesciption:“first code” }
{ “shopcode”:“b”, shopcodedesciption:“second code” }
{ “shopcode”:“c”, shopcodedesciption:“third code” }

Is it possible to join the first set with the second set to yield a unified/nested result set like the one below:

{ “shopid”:“1”, “shopcodes”:[“a”,“c”], shopcodedescription:[“first code”,“third code”] }
{ “shopid”:“2”, “shopcodes”:[“b”], shopcodedescription:[“second code”] }

For every shop code in a record, nest all of its corresponding shopcodedescription.