What's the equivalent of Entity.all(keys_only=True).fetch(20) in NDB?

♀尐吖头ヾ 提交于 2020-01-01 08:43:38

问题


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?


回答1:


Found it in the GAE NDB Docs. The answer is Entity.query().fetch(20,keys_only=True).



来源:https://stackoverflow.com/questions/10203874/whats-the-equivalent-of-entity-allkeys-only-true-fetch20-in-ndb

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!