Inserting a row in child table using servers scripting

I had created a doctype and then created a child doctype and is trigged by server script using api but i am unable to insert a row in child table can you help me out with this how can i do that using servers script with api

new_doc = frappe.get_doc({
    "doctype":"Test",
    "field_1": "Value of field_1",
    "items" : [{
        "child_field" : "value of child_field"
    }]
}).insert(ignore_permissions=True,ignore_mandatory=True)
new_doc.save()
2 Likes

thankyou so much its working