[Solved] Need two object types in one array with SimpleSchema in mongodb


I have two object schema as following:
const moveSchema = new SimpleSchema({
move: {type: String}
const takebackSchema = new SimpleSchema({
takeBack:{ type: String, allowedValues: [“request”,“accept”,“reject”]},

and I want above two in one array like below:

actions: [moveSchema ,takebackSchema]

Above code should give me output like below:

“move” : “e3”
“takeBack” : “request”

but I’m not able to do so. Please guide.


1 Like

Thank you David.