Reputation: 595
I try filtering ID such as the following
ancestorid id value
1111 aaaa 10 // I want to fetch this
1111 bbbb 20
2222 aaaa 30 // and this.
2222 cccc 40
but, I cannot find filtering by id in ndb.query reference.
I can filter by key.But It's needed ancestor key(id). I want to fetch crossing entity group.
How to filter by ID with ndb.query?
Upvotes: 0
Views: 269
Reputation: 39824
You can't do that with a single query. That's because if you make an ancestor query you'll only get results from that ancestor entity group and if you don't make an ancestor query you'll only get entities which have no ancestors. All these queries would have non-overlapping results.
The only way to obtain the results you want would be with multiple queries:
Upvotes: 2