Doc.save() Creating new records not updating existing records

Hi there!! I have a doctype and i have written server script for updating field values of another doctype records.

I used frappe.get_doc method to fetch the record but when i changed the values and tried doc.save() at the end.

It updates the values with creating new records and I dont want to create new records.
I just need to update with existing records.

Kindly help!!!
Thanks in advance.

Share your code.

[Edit]

Existing value update for check your topic.

Thanks.