Mutating ndb repeated property
There is no automatic way of doing this.
You need to perform queries for all types that could hold the key and then delete them in code.
If there could be a lot and/or it could take a long time you might want to consider using a task.
I have two classes, Department and Employee. Department has a property declared as
employees = ndb.KeyProperty(kind=ClassB, repeated=True)
The problem is,when i delete the entity whose key is held in the employees list, the entity is deleted in the Employee datastore, but the list in Department datastore remains the same (with the key of the deleted employee still in it).
How do i make sure that when the Employee is deleted, all references to it in the Department datastore is deleted as well?