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

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

问题描述

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

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

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

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

谢谢。

解决方案

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


I have about 1000 user account entities like this:

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

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?

Thank you.

解决方案

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天全站免登陆