This may lead bug in future as it doesn't guarantee the order of keys. Moreover it is recommended that fields with fixed values should be defined in the schema itself. So that it'll easy to switch from one application to other;
Proposed schema
var schema = [
{
fieldName : "state",
type : "fixed",
values : [
[ "running",1] , [ "ready", \u1234 ] , [ "stop", 's' ]
]
},{
fieldName : "desc",
type : "dynamic",
},{
fieldName : "skills",
type : "list",
value : {
type : "dynamic",
}
},{
fieldName : "skills",
type : "map",
value : [
{},{},{}
]
}
]
nimn js use simplified object structure to defined the schema of an object;
This may lead bug in future as it doesn't guarantee the order of keys. Moreover it is recommended that fields with fixed values should be defined in the schema itself. So that it'll easy to switch from one application to other;
Proposed schema