0
我在反思分貝兩個文件像下面合併兩個表中的記錄
角色:
{"Name": "client" ,"id": "dfd1a03d-ddb2-458e-8379-f443daa0fcfd"}
{"Name": "admin" ,"id": "c1ed66a4-8e72-416b-8237-c4a0518826c8"
}
用戶:
{"id": "ae9aaaea-24b6-4880-9a81-d6ee34c82dde" ,
"password": "$2a$10$MqaQjif6bigsoYV82s/SXeWsQQ9.NnEPykw1L/nLcfOmWRryq8XJe" ,
"roles": ["c1ed66a4-8e72-416b-8237-c4a0518826c8" ,"dfd1a03d-ddb2-458e-8379-f443daa0fcfd"
] ,
"userName": "jbadly"
}
,我想合併這兩個表中的記錄並顯示如下
{"id": "ae9aaaea-24b6-4880-9a81-d6ee34c82dde" ,
"password": "$2a$10$MqaQjif6bigsoYV82s/SXeWsQQ9.NnEPykw1L/nLcfOmWRryq8XJe" ,
"roles": ["admin" ,"client"] ,"userName": "james"}
大。這對我行得通。 –
現在,如果用戶只有一個角色,那麼它會在「RqlRuntimeError:預期類型ARRAY但在STRING中找到」時拋出異常。 –