Have you ever seen duplicate IDs when using Google App Engine and ndb?

Appengine production db

class Entries(ndb.Model):
  description = ndb.StringProperty()
  seqid = ndb.IntegerProperty()
  link = ndb.StringProperty()
  group = ndb.StringProperty()
  timestamp = ndb.StringProperty()
  referrals = ndb.StringProperty(repeated=True)

      

The two entries in the picture are created by two different users. The user is the parent of the Entry.

I am getting a duplicate ID on production, but not local. Also, it always has the same id number (but it certainly isn't hardcoded anywhere)

Since the parent is a user, I can still pull it out as a unique record, but that would mean there will be problems if I have two records with the same parent user.

+3


source to share


1 answer


A unique data store key is a fully qualified key, including all parent entities, not just the identifier. Multiple objects with the same ID and different parents are completely valid, and you shouldn't rely on just a single ID.



+4


source







All Articles