Json 概念化noSQL。。。在聚会中使用魔法

Json 概念化noSQL。。。在聚会中使用魔法,json,mongodb,nosql,Json,Mongodb,Nosql,所以,我一直在使用SQL。这是我所知道的,真的,但我真的想了解如何概念化文档数据 { "MBS":{ "name":"Mirrodin Besieged", "code":"MBS", "releaseDate":"2011-02-04", "border":"black", "type":"expansion", "block":"Scars of Mirrodin", "cards":[ {"layout":"norma

所以,我一直在使用SQL。这是我所知道的,真的,但我真的想了解如何概念化文档数据

{
  "MBS":{
    "name":"Mirrodin Besieged",
    "code":"MBS",
    "releaseDate":"2011-02-04",
    "border":"black",
    "type":"expansion",
    "block":"Scars of Mirrodin",
    "cards":[
      {"layout":"normal",
      "type":"Creature — Human Knight",
      "types":["Creature"],
      "colors":["White"],
      "multiverseid":214064,
      "name":"Hero of Bladehold",
      "subtypes":["Human", "Knight"],
      "cmc":4,
      "rarity":"Mythic Rare",
      "artist":"Austin Hsu",
      "power":"3",
      "toughness":"4",
      "manaCost":"{2}{W}{W}",
      "text":"Battle cry (Whenever this creature attacks, each other attacking creature gets +1/+0 until end of turn.)\n\nWhenever Hero of Bladehold attacks, put two 1/1 white Soldier creature tokens onto the battlefield tapped and attacking.",
      "number":"8",
      "watermark":"Mirran",
      "rulings":[
        {"date":"2011-06-01", "text":"Whenever Hero of Bladehold attacks, both abilities will trigger. You can put them onto the stack in any order. If the token-creating ability resolves first, the tokens each get +1/+0 until end of turn from the battle cry ability."},
        {"date":"2011-06-01", "text":"You choose which opponent or planeswalker an opponent controls that each token is attacking when it is put onto the battlefield."},
        {"date":"2011-06-01", "text":"Although the tokens are attacking, they never were declared as attacking creatures (for purposes of abilities that trigger whenever a creature attacks, for example)."}
      ],
      "imageName":"hero of bladehold",
      "foreignNames":[
        {"language":"Chinese Traditional", "name":"銳鋒城塞勇士"}, 
        {"language":"Chinese Simplified", "name":"锐锋城塞勇士"},
        {"language":"French", "name":"Héroïne de Fortcoutel"}, 
        {"language":"German", "name":"Held der Klingenfeste"}, 
        {"language":"Italian", "name":"Eroina di Rifugio delle Lame"},
        {"language":"Japanese", "name":"刃砦の英雄"},
        {"language":"Portuguese (Brazil)", "name":"Herói de Bladehold"}, 
        {"language":"Russian", "name":"Герой Блэйдхолда"}, 
        {"language":"Spanish", "name":"Héroe de Fortaleza del Filo"}
      ], 
      "printings":["Mirrodin Besieged"]},
      {next card...},
      {next card...},
      {next card...},
      {last card...}
    ]
  },
  {next set...},
  {next set...},
  {last set...}
}
因此,我有一个json文件,其中包含来自Magic的所有卡片:聚会。json被“分割”成不同的集合。因此,如果我以某种方式将其导入noSQL数据库(mongoDB):

什么构成文件

每一套都是文件吗

每张卡片都是文件吗

什么是好的结构

此时查询是如何工作的。。。如果我在找东西,这只是一个巨大的“文本搜索”吗


我只是想了解一下noSQL。

JSON是有效的,但这取决于您希望如何处理卡中的数据。由于您目前已经构建了一些东西,因此您拥有一个大型文档,其中所有卡片都位于子数组中,而不是作为文档。结构取决于你想如何使用这些数据,你能提供一些关于你想用它做什么的更深入的见解吗?我想有一个数据库来分别搜索这些卡片。我建立了一个类似的网站(还没有建立),只显示实际的卡片,没有BS。我正在重建它,想尝试一下noSQL。我不喜欢用问题来回答问题,但我应该如何组织它?在我回答之前,我必须问另一个问题,但主要是您打算使用您的网站查询什么/您经常会问哪些关于存储的卡数据的问题?
卡[:名称]
卡[:颜色]
cards[:type]
使用noSQL数据库可以进行这种类型的查询。这是一个四种不同用例设计的示例,其中有一个关于如何设计模型的好PDF文件——从您自己的应用程序的角度浏览这些文档将帮助您了解如何构建数据库。