最初,消息字段(Strapi 可重复组件)将如下所示。
"messages":[
{
"from": "user1",
"_id": "5f787348628eea0017b49f7e",
"text": "happy hello world",
"createdAt": "2020-10-03T12:49:12.052Z",
"updatedAt": "2020-10-03T12:49:12.052Z",
"__v": 0,
"id": "5f787348628eea0017b49f7e"
}
]
我想向可重复组件添加另一条消息:
"messages":[
{
"from": "user2",
"text": "happy hello world"
}
]
当我通过 curl 放置它时:
curl -i -X PUT \
-H "Content-Type:application/json" \
-d \
'{
"messages":[
{
"from": "shop",
"text": "happy hello world"
}
]
}' \
'https://myserver/mes/5f781bdd23e08f001732cdd8'
它会覆盖之前的消息。如何在不丢失任何先前数据的情况下添加其他消息?
慕容708150
相关分类