作者CMJ0121 (请多指教!!)
看板Python
标题Re: [问题] google datastore 几个疑问
时间Sun Sep 4 06:59:23 2011
在 GAE中的 datastore
储存的东西我假装叫做 entity
那这个东西可以放很多你想要给他的 property(像是姓名/图片/email等等)
现在你已经上传一个 entity A (name: John)
经过put之後就会在datastore中 insert一笔资料
其中会自动产生这个 Key 这个property
可以当作是资料库中的 primary key 他是唯一且可以辨识
如果你在put一样的 entity A (name: John)
那 GAE会当成是你要insert一笔新的资料
只是跟原本的长的一模一样
如果是要做 update 则需要在put时给予 key值
找寻key值的方式是用 gql的查询方式
可以利用已知的条件去找到满足的 entity 再得到他的key 值
http://code.google.com/intl/zh-TW/appengine/docs/python/datastore/creatinggettinganddeletingdata.html
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 140.114.91.77