Task: I have created a content-type ParentElement
which has a field category
as a reference to another content-type defined. Now I want to import/create several content entries for the ParentElement
where I want to create also new categories
and then link the newly created category to the ParentElement
(see code-example) and upload it via the contentful-cli (contentful space import [...]
).
Question: Is there a way to create new entries of a referenced-content-type inside of the json which then should be imported via the contentful-cli?
Code-Example:
{
"entries": [
{
"sys": {
"contentType": {
"sys": { "type": "Link", "linkType": "ContentType", "id": "expertItemNew" }
}
},
"fields": {
"title": {
"de-DE": "Title1",
"en": "Title1"
},
"category": {
// referencing to a category which already exists
"de-DE": { "sys": { "type": "Link", "linkType": "Entry", "id": "xTx8oAEnSr3MBr8wAIaik" } }
},
"street": { "de-DE": "Mainstreet 1" }
}
},
{
"sys": {
"contentType": {
"sys": { "type": "Link", "linkType": "ContentType", "id": "expertItemNew" }
}
},
"fields": {
"title": {
"de-DE": "Title2",
"en": "Title2"
},
"category": {
//** How can I create a new reference and not just referencing one which already exists?**
"de-DE": { /**???**/ } }
},
"street": { "de-DE": "Mainstreet 2" }
}
},
]
}