Google App Engine: Modifying 1000 entities

2024/9/20 17:23:33

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 [email protected]. 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.

Answer

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.

https://en.xdnf.cn/q/119299.html

Related Q&A

more efficient method of dealing with large numbers in Python? [closed]

Its difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying thi…

MLM downline distribution count

I make my first MLM software and I think I managed to code how to get the points from the downline even though it is a recursive problem I didnt use recursion and I might refactor to a recursive versio…

Can someone please explain to me the purpose of the asterisk in Python? [duplicate]

This question already has answers here:What does asterisk * mean in Python? [duplicate](5 answers)How are pythons unpacking operators * and ** used?(1 answer)Closed 5 years ago.For instance, can some…

Linear Programming with cvxpy

I would like to ask you regarding on the Linear Program for optimization.I have an objective function, and constraint functions as below,variables(x1, x2, x3, x4, x5, x6) are quantities of the products…

Program runs forever without giving an error when plotting data only on continent [closed]

Its difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying thi…

KeyError while perfoming solve of two equation

1st i need to get two equation of two longest line length i put lenghths with eq in list like these [( length 1 , eq 1 ) ,.....] sort list with reverse get two equation of two longest line when run the…

Most Pythonic way to merge two dictionnaries having common key/value pair

I have two lists of python dictionnaries : l1 = [{"id":1, "name":"A"}, {"id":2, "name":"B"}] l2 = [{"id":1, "full_name":&…

How to close a while True loop instantly Python

I have a problem ... How can i press P on my keyboard and close the entire program faster ( i would like instantly ) ? The script that i made runs in a loop ( Loop B ) and checks for an image on deskt…

How to replace a value in a list

the program asks user to enter 5 unique number, if the number is already in the list, ask for a new number. after 5 unique numbers have been entered, display the listnumbers = [1,2,3,4,5] count = 0 ind…

How To Reverse A Nested Python List

Given the following nested list,myList=([1,[2,3],[[4,5,[6],7],8,9]])I want to reverse it to be converted into:myList= [[[4, 5, [6], 7], 8, 9], [2, 3], 1]How do I do that? Thanks.