pretty new to mongoose, I have my dropdown options in the structure below. This way the overall group holds the collection of dropdown options... a task page would have options for "status", "result", a user page have "typePhone", etc.
what is the correct way build a Schema for such a structure? Thinking I'm going to have to transform it to the below somehow if I can't store as is.
{
"task": {
"status": [
{
"key": 0,
"text": "pending"
},
{
"key": 1,
"text": "in progress"
},
{
"key": 2,
"text": "completed"
},
{
"key": 3,
"text": "cancelled"
}
],
"result": [
{
"key": 0,
"text": ""
},
{
"key": 1,
"text": "good"
},
{
"key": 2,
"text": "not good"
},
{
"key": 3,
"text": "who knows"
}
]
},
"user": {
"typePhone": [
{
"key": "1",
"text": "Landline"
},
{
"key": "2",
"text": "Mobile"
},
{
"key": "3",
"text": "Other"
}
]
}