Search code examples
pythongoogle-app-enginegoogle-cloud-datastoregoogle-account

GAE DataStore: query a existing by user_id field


I have saved the user_id() field and now I want to query the datastore for that user. How would I go about accomplishing that?

#Something like
user = db.Query(MyUser).filter('user.user_id() = ', 1234).fetch(limit=1)

Thanks


Solution

  • You should create a separate string property to store the user ID, then query for that. The UserProperty class is full of traps and is best avoided.