the parent_path property could work. thanks. On Monday, June 25, 2012 11:49:12 AM UTC+8, timh wrote: > > Hi > > Here is one approach you could use. > > In each entity store a list of paths of each parent. ie in second scenario > > H has a list property called parent_paths it would have the following > values ['/a/g','/a'] and its children would have ['/a','/a/g','/a/g/h'] etc > > Then given any entity you can fetch all levels of descendants. So in your > example you just need to query for any entity > that has '/a/g/h' in its parent_paths. This doesn't allow you to > restrict depth though. > > Cheers > > Tim > > On Monday, June 25, 2012 11:17:50 AM UTC+8, gor wrote: >> >> *Scenario 1:* >> If I have a Great Grandpa ancestor (let's name him A); And my key is from >> "child1"; is there a way to check that my great grandpa is A? (hope I can >> do that without needing to loop) >> >> Or can I check, if child1's key is of the path "A->B->C". >> *A -> B -> C -> (child1, child2...)* >> >> *Scenario 2:* >> From the above. Great Grandpa has another descendants from "G", and would >> like to retrieve "H"s children: >> >> *A-> B -> C -> (children of C)* >> *...-> G -> H -> (children of H)* >> >> I like to retrieve "H"s children, thinking that Grandpa knows the path >> from A, G, to H... can I do that? (hope I can do this in a query, without >> looping) >> >> If you have a Go1 example: that would be awesome... >> >> Thanks Google! and I love you! >> >> >>
-- You received this message because you are subscribed to the Google Groups "Google App Engine" group. To view this discussion on the web visit https://groups.google.com/d/msg/google-appengine/-/JUa55BAGTfIJ. To post to this group, send email to google-appengine@googlegroups.com. To unsubscribe from this group, send email to google-appengine+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-appengine?hl=en.