How to change the ancestor of an NDB record?

In a highly replicated data warehouse (I use NDB), consistency will be possible. To get a guaranteed kit, you can use the requests of the ancestors. Ancestral inquiries also provide a great way to get all the β€œchildren” of a particular ancestor with carefree inquiries. In short, the ability to use the ancestor model is extremely useful in GAE.

The problem, which, it seems to me, is quite simple. Say I have a contact record and a message record. This contact record is considered as the ancestor for each message. However, it is possible that two contacts were created for the same person (user error, different data points, whatever). This situation creates two contact entries that have messages associated with them.

I need to be able to "combine" two records and bring all the messages into one big heap. Ideally, I could change my ancestor for one of the record children.

The only way I can do this is to create a mapping and check my application to see if the record has been merged. If so, look at the mappings to find one or more related records and query against them. This seems extremely inefficient. Is there a book-by-word way to handle this use case?

+5
source share
1 answer

- . ( ..) . , .

, . (.. ) , .

+9

All Articles