class Parent(Document):
list_items = ListField(EmbeddedDocumentField(Child))
class Child(EmbeddedDocument):
name = StringField()
I have created a function to delete the embedded document from the ListField using the
pull - Atomic Operator
Please check below:
def deleteItem(parent_id,name):
Parent.get(id=parent_id).update_one(pull__list_items__name=name)
My question is how am i sure that this atomic update was performed successfully?
How would i know if the list item actually exists in the parent object ?