我有一个包含以下内容的 JSON 文件:-
{
"content": "{\"accountNumber\":\"12345\",\"transactionId\":\"568\",\"socialSecurityNumber\":\"123456796\",\"identificationNumber\":1,\"securityCode\":\"1234\",\"dateOfBirth\":\"1000-01-01\",\"firstName\":\"qwerty\",\"lastName\":\"xyz\",\"balance\":123}",
"contentType": "application/json",
"createdAt": "2020-11-11T12:55:41.350+0000",
"cryptoKeyId": null
}
我只想更新firstName的值。我想要的最终结果是
{
"content": "{\"accountNumber\":\"12345\",\"transactionId\":\"568\",\"socialSecurityNumber\":\"123456796\",\"identificationNumber\":1,\"securityCode\":\"1234\",\"dateOfBirth\":\"1000-01-01\",\"firstName\":\"abcdef\",\"lastName\":\"xyz\",\"balance\":123}",
"contentType": "application/json",
"createdAt": "2020-11-11T12:55:41.350+0000",
"cryptoKeyId": null
}
我试过这个
( .content | fromjson.firstName = "abcdef" )
但没有成功。你能帮我吗?谢谢