Hello, let say I have a collection where a data structure have the following view:
{
"_id" : "puAy4j4KnNNRpKGzW",
"title" : "Some category",
"type" : "category",
...
},
...
{
"_id" : "aF7GZh4k3TZHiBqpk",
"title" : "Some product",
"type" : "product",
...
},
...
{
"_id" : "3amLTwhsDYue4qJYW",
"title" : "Some product variant",
"type" : "variant",
...
},
...
{
"_id" : "M9H35NXTmuSyKPtA2",
"title" : "Some variant option",
"type" : "option",
...
}
each type of doc has its own unique fields, also there is a common fields for all types. To manage that collection2 and simpleschema are used.
My question is how to build schema for such kind of pattern?