Re: [問題] google datastore 幾個疑問
在 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
討論串 (同標題文章)
Python 近期熱門文章
PTT數位生活區 即時熱門文章