I'm using Google App Engine NDB. Sometimes I will want to get all users with a phone number in a specified list. Using queries is extremely expensive for this, so I thought I'll just make the id value of the User entity the phone number of the user so I can fetch directly by ids.
The problem is that the phone number field is optional, so initially a User entity is created without a phone number, and thus no value for id. So it would be created user = User()
as opposed to user = User(id = phone_number)
.
So when a user at a later point decides to add a phone number to his account, is there anyway to modify that User entity's id value to the new phone number?