有没有一种方法可以为ndb.get_multi()指定投影? [英] Is there a way to specify a projection for ndb.get_multi()?

查看:127
本文介绍了有没有一种方法可以为ndb.get_multi()指定投影?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用NDB,可以指定投影用于查询,从而可以限制为与查询匹配的实体检索的属性的数量.

Using NDB, it is possible to specify a projection for a query, allowing to limit the number of properties that are retrieved for the entities that match the query.

但是,我在文档中找不到任何有关使用 ndb.get_multi()时如何指定投影的信息,该代码总是获取完整的实体.

However, I couldn't find anything in the documentation about how to specify a projection when using ndb.get_multi(), which always fetches complete entities.

使用 ndb.get_multi()时是否只能获取某些属性?

Is there a way to fetch only certain properties when using ndb.get_multi()?

推荐答案

否,投影功能仅适用于查询.投影get()操作不会有任何优势(就减少I/O操作而言).

No, the projection feature only works for queries. There would be no advantage (in terms of fewer I/O operations) to projecting get() operations.

这篇关于有没有一种方法可以为ndb.get_multi()指定投影?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆