NDB中的Entity.all(keys_only = True).fetch(20)等价于什么? [英] What's the equivalent of Entity.all(keys_only=True).fetch(20) in NDB?
本文介绍了NDB中的Entity.all(keys_only = True).fetch(20)等价于什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
Entity.all(keys_only = True)。如何在NDB中获得以下查询的等效结果? fetch(20)
我知道你可以传递'keys_only = True'
到 iter()
方法。但是,如果我只想执行一个键只读取,我该如何在NDB中执行该操作呢?
Entity.query()。fetch(20,keys_only = True)
。 How do I get the equivalent result of the following query in NDB?
Entity.all(keys_only=True).fetch(20)
I know you can pass 'keys_only=True'
to the iter()
method. But what if I want to perform a keys only fetch, how do I do that in NDB?
解决方案
Found it in the GAE NDB Docs. The answer is Entity.query().fetch(20,keys_only=True)
.
这篇关于NDB中的Entity.all(keys_only = True).fetch(20)等价于什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文