How to Model Dynamic Predicate Schema

Hi Guys,
How to achieve the below schema where “attr” is totally dynamic and it varies according to the category of the Product,

According to the documentation,the only way i could see is using facets for the predicate attr.
Are the facets indexed ? Please clarify or help me achieve the design…

{
    "name" : "Product Name",
    "description" : "Description of the product",
    "picture" : {
        "lg" : "xxxxxxxx/prod-1577700854620-lg",
        "md" : "xxxxxxxx/prod-1577700854620-md",
        "sm" : "xxxxxxxx/prod-1577700854620-sm"
    },
    "gtin" : "",
    "attr" : {
        "nature" : {
            "id" : "2",
            "name" : "Natural"
        },
        "type" : {
            "id" : "1",
            "name" : "SEC"
        },
        "size" : {
            "name" : "0,75 L",
            "id" : "2"
        },
        "color" : {
            "id" : "2",
            "name" : "WHITE"
        },
        "ranking" : {
            "id" : "1",
            "name" : "AOC"
        },
        "year" : "2018",
        "appelation" : "",
        "grapes" : ""
    },
    "category_type" : "CATEGORY1",
    "country" : {
        "code" : "fr"
    },
    "producer" : {
        "name" : "Producer Name",
        "id" : ""
    },
    "createdby" : "root",
    "createddate" : ISODate("2019-12-30T10:41:52.675Z"),
    "modifiedby" : "root",
    "modifieddate" : ISODate("2019-12-30T10:41:52.675Z")
}

I think you could just merge the names such as attr-nature-id, attr-nature-id-name and so on. Seems straight forward to me. Is there anything I am missing?

Thanks @amanmangal.I am following the same format as you rececommended as facets.

My other doubt is - Are the facets indexed ? or can they be indexed to achieve performance…

Facets cannot be indexed.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.