开发者

Clean datastore for GoogleAppEngine

How to clear datastore in GoogleAppEngine.

I want to clear my development data to do a test again, but I can found a way开发者_开发问答 to do that


If you are running from the commandline, use the --clear_datastore flag, e.g.,

dev_appserver.py --clear_datastore=yes app

Otherwise, if you're running it off the included GAE launcher, go into the settings of your app (double click it), and there should be a little checkbox that says "clear datastore on launch" under Launch Settings.

reference: https://cloud.google.com/appengine/docs/python/tools/devserver#Python_Using_the_Datastore


dev_appserver.py --clear_datastore myapp 

assuming by "development data", you mean the data in the dev server.


Simply use Administering Your Datastore (Experimental)

Some Other ways App Engine: How to "reset" the datastore?

Delete all data for a kind in Google App Engine

Interactive console is also a great way.


For Java, the following information can be seen in Using the Datastore - Clearing the Datastore at the end of the page (as of 2013/05/10):

The development web server uses a local version of the Datastore for testing your application, using local files. The data persists as long as the temporary files exist, and the web server does not reset these files unless you ask it to do so.

The file is named local_db.bin, and it is created in your application's WAR directory, in the WEB-INF/appengine-generated/ directory. To clear the Datastore, delete this file.

So, stop your server, delete the file, and restart it up.


On your local machine you can go to : http://localhost:8080/_ah/admin/datastore

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜