Delete record linked with other document(server script)

I want to delete record linked with other document after unlinking it.
How i can write delete query or method in server script.

doc = frappe.get_doc(doctype, docname)
doc.delete()
1 Like

first i want to unlink it. how it is possible with code.

target_doc.link_field = ''

is there any other way??
can we add something as an argument of delete method ?

i want to delete current doc and unlink it from another docs at same time