2017-04-12 2 views
0

Ich entwickle einen Bot, es hat mehr Eltern und Kind Button Keyboard Menü, und ich möchte auf jede Schritte zugreifen, ist mein Datenmodell gut? und wie kann ich das verbessern? Dies ist mein Datenmodell:Document Store Datenmodellierung für Baum (Datenstruktur)

{ 
    "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" 
     } 

    } 
} 

Antwort

0

ich ein gutes Datenmodell finden parent,child,left,right,path

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

    } 
}