Question: jion tow object on keys,then insert one to another

hi:
I query via NIQL statements:

    select 
    OBJECT_CONCAT({"adminId": adm},{"logs":logs})
    FROM lesson as logs
    JOIN lesson AS adm ON KEYS logs.adminId

return:

[
  {
    "$1": {
      "adminId": {
        "createdTime": 1534333674040,
        "departmentId": "Department::1534333631008::japq",
        "isSuper": true,
        "mobile": "test Admin",
        "name": "test Admin",
        "password": "test Admin",
        "type": "Admin",
        "username": "test Admin"
      },
      "logs": {
        "adminId": "Admin::1534333674040::468r",
        "classId": "Class365::1534142979269::e3wm",
        "createdTime": 1534405376506,
        "description": "this is a first desc",
        "type": "AdminLogs"
      }
    }
  }
]

I want to replace logs object adminId property with adminId object.

like this:

[
  {
      "logs": {
        "adminId": {
            "createdTime": 1534333674040,
            "departmentId": "Department::1534333631008::japq",
            "isSuper": true,
            "mobile": "test Admin",
            "name": "test Admin",
            "password": "test Admin",
            "type": "Admin",
            "username": "test Admin"
         },
        "classId": "Class365::1534142979269::e3wm",
        "createdTime": 1534405376506,
        "description": "this is a first desc",
        "type": "AdminLogs"
      }
    }
]

how does it?

thanks for your reply.

best regards!

select 
    OBJECT_PUT(logs,"adminId",adm) AS logs
    FROM lesson as logs
    JOIN lesson AS adm ON KEYS logs.adminId

@vsr1

great! thank you very much!

hi @vsr1
this statement works for me when joining two objects.

select 
    OBJECT_PUT(OBJECT_PUT(logs,"adminId",adm),"classId", class)
    FROM guoxue as logs
    JOIN guoxue AS adm ON KEYS logs.adminId
    JOIN guoxue as class ON KEYS logs.classId

Is this N1QL right?

best regards!

It is right.

You can also try this, If format works out.

SELECT
    logs.*, adm AS adminId, class AS classId
    FROM lesson as logs
    JOIN lesson AS adm ON KEYS logs.adminId
    JOIN guoxue as class ON KEYS logs.classId;

hi:

this N1QL statement is clear logic, thanks~~