Iterate on an defined object

I still need a little bit of help

WITH data AS ([{"cc":"us", "app_id":"123"},{"cc":"gb", "app_id":"123"}])
SELECT OBJECT TO_STR(v3.app_id):v3 FOR v3 IN applications END AS apps
LET applications = (
    SELECT app_uuid,
           app_id,
           bla,
           foo,
          bla1
         country_code
    FROM `bucket` USE KEYS ARRAY v2 FOR v2 IN (
        SELECT RAW "meta:" || d2.app_uuid || ":" || d.cc
        FROM data AS d
            JOIN `app-live` AS d2 ON KEYS "app:a2t:" || d.app_id ) END)

and I am trying to get the resutls in this format:

{
   "apps":{
      "123":{
         "us":{
            "app_uuid":"123-abc",
            "country_code":"us"
         },
         "gb":{
            "app_uuid":"456-abc",
            "country_code":"gb"
         }
      }
   }
}

I tried to do the following and it is not working, I also tried with add_object or create another object inside the return of the previous select (applications) and nothing seems to work. Can I do what I want?

SELECT OBJECT TO_STR(v3.app_id.[to_str(v3.country.code)]):v3 FOR v3 IN applications END AS apps