I am working with realm flexible sync in react native and i want to define schema for below json where key names are dynamic objectId and has set of properties so i tried dictionary and mixed but didn't worked. Also this group_taxes would have n of key values.
{
"group_taxes": {
// This one is dynamic object id as key which holds properties
"63bbb1372aea3a5f887b4d0e": {
"tax_id": {
"$oid": "63bbb1372aea3a5f887b4d0e"
},
"tax_name": "CGST",
"tax_rate": 10,
"calculated_tax": 44,
"tax_calculation": "PERCENTAGE"
},
"63bbb1372aea3a5f887b4d10": {
"tax_id": {
"$oid": "63bbb1372aea3a5f887b4d10"
},
"tax_name": "SGST",
"tax_rate": 20,
"calculated_tax": 20,
"tax_calculation": "FLAT_VALUE"
}
}
}
What i tried to define in schema as below but didn't worked
{
"group_taxes" : {
"bsonType": "mixed"
}
}