Google App Engine:修改 1000 个实体 [英] Google App Engine: Modifying 1000 entities

查看:30
本文介绍了Google App Engine:修改 1000 个实体的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有大约 1000 个这样的用户帐户实体:

I have about 1000 user account entities like this:

class UserAccount(ndb.Model):
    email = ndb.StringProperty()

其中一些电子邮件值包含大写字母,例如 JohnathanDough@email.com.我想从所有 UserAccount 实体中选择所有 email 值并应用 python 的 email.lower().我怎样才能有效地做到这一点,最重要的是,没有错误?

Some of these email values contain uppercase letters like JohnathanDough@email.com. I want to select all the email values from all UserAccount entities and apply python's email.lower(). How can I do this efficiently, and most importantly, without errors?

注意:电子邮件值对于登录很重要,所以我不能把它搞砸.有没有办法备份这些数据,以防万一我犯了错误?

Note: The email values are important for login, so I cannot afford to mess this up. Is there a way to backup this data in case of the event that I do make a mistake?

谢谢.

推荐答案

是的,当然.即使数据存储管理是一项实验性功能,我们也可以在不编码的情况下备份和恢复数据.按照备份流程的说明进行操作:备份数据.要处理您的数据,最有效的方法是使用 MapReduce 库.

Yes, off course. Even if Datastore Administration is an experimental feature we can backup and restore data without coding. Follow this instruction for the backup flow: Backing up data. To processing your data instead, the most efficient way is to use the MapReduce library.

这篇关于Google App Engine:修改 1000 个实体的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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