问题
I have a simple model:
class MyEntry(db.Model):
keyName = db.StringProperty()
valuesList = db.StringListProperty()
and I want to populate the datastore with about 7000 instances of this entity from a file. (I have a function that reads from the file, creates the entities and puts them to the db)
I'm using the Interactive Console from the SDK Console to do the exporting (or better, the instantiation). However, even when I try to export the instances in batches of 400, after 1000 instances are created the datastore stops accepting new instances. I don't think this is a timeout problem, because I am deliberately doing things in small batches (after I tried the whole things at once).
Is this a known problem? I wasn't able to find any info that documents this. Is there some other way to export data into the local datastore?
Thanks.
回答1:
I was able to find the answer in an older post:
App Engine Datastore - devserver limits
Apparently, years ago there has been a 1000 limit, which was lifted, but the dev-server still has it somehow.
So, I tested the datastore differently (by accessing every instance of MyEntry) and it turns out that all instances are there, however, the development server console only shows 1000 instances.
In fact, MyEntry.all().count() will also return 1000.
来源:https://stackoverflow.com/questions/9542564/is-there-any-limit-for-the-local-datastore-running-google-app-engine-python