[英]How to mutate a ndb repeated property?
The appengine docu says on repeated ndb properiertes, that: appengine文件说明了重复的ndb专业人士:
When updating a repeated property, you can either assign it a new list or mutate the existing list in place.
更新重复属性时,您可以为其分配新列表或改变现有列表。
https://developers.google.com/appengine/docs/python/ndb/properties#repeated https://developers.google.com/appengine/docs/python/ndb/properties#repeated
Two questions: 两个问题:
do I save write operations when I just mutate the list, instead of putting a new list in place? 我只是改变列表而不是添加新列表时保存写操作?
how do I do exactly the mutation? 我该怎么做突变? just append the object and delete items within the list as I would do it with a list in python?
只需附加对象并删除列表中的项目,就像我在python中使用列表一样?
Thanks! 谢谢!
Yes you have it correct in your mind. 是的,你的想法是正确的。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.