2017-04-12 10 views
0

私はボットを開発しています。より多くの親子を持っています。Button Keyboardメニュー、各ステップにアクセスしたい、データモデルは良いですか?どのように改善することができますか? これは私のデータモデルである:ツリー(データ構造)のドキュメントストアデータモデリング

{ 
    "Keyboard": { 
     "StartKeyboard": [ 
      "Content", 
      "Start", 
      "About" 
     ], 
     "Start": { 
      "parent": "StartKeyboard", 
      "childs":[ 
       "⚙️111⚙️", 
       "222", 
       "333", 
       "4444", 
       "555" 
      ] 
     }, 
     "About": { 
      "parent": "Start", 
      "childs":[ 
       "111111111", 
       "2222222222", 
       "33333333333333", 
       "444444444", 
       "55555555555" 
      ] 
     } 
     "Content":{ 
      "message": "54645465468545485454654654654" 
     } 

    } 
} 

答えて

0

私はparent,child,left,right,path

{ 
    "Keyboard": { 
     "StartKeyboard": [ 
      "Content", 
      "Start", 
      "About" 
     ], 
     "Start": { 
      "parent": "StartKeyboard", 
      "childs":[ 
       "4444", 
       "555" 
      ] 
      "left": 
      "right": 
      "path": Keyboard.StartKeyboard.Start 
     } 

    } 
} 
良いデータモデルを探します