0
如何在MySQL中映射上述數據結構? 我想知道如何爲Tags
鍵分配多個值。MySQL中有多個鍵值的數據結構
這是CouchDB教程的一個例子。
{
"Subject": "I like Plankton",
"Author": "Rusty",
"PostedDate": "5/23/2006",
"Tags": ["plankton", "baseball", "decisions"],
"Body": "I decided today that I don't like baseball. I like plankton."
}
需要一個名爲'tag'的新表,並且在你的(我猜)'post'表上創建'tag'表的外鍵。但是如果你有'多對多'關係,事情並不那麼簡單。我建議你恢復與couchdb,沒有MySQL .. – hgoz 2013-03-09 22:05:08
謝謝大家的回覆。我發現了一篇關於MySQL中多對多關係的好文章(http://tagging.pui.ch/post/37027745720/tags-database-schemas)。事實上,正如@ hgoz [建議](http://stackoverflow.com/questions/15316379/data-structure-with-multiple-values-for-key-in-mysql#comment21623546_15316379)最好留在CouchDB或MongoDB中: ) – bns 2013-05-30 12:42:15