I am trying to push something like [ { a:[ ], b: [ ] }, { a:[ ], b: [ ] }, ]
inside the array field of the document.
Heres what my mongoose schema looks like-
const GameLogSchema = new Schema({
_score: Number,
_playerData: {
x: Number,
y: Number,
},
_zoneData: [{ _x: Number, _height: Number }],
_pipeData: [{ _x: Number, _randomeHeightTop: Number }],
_gap: Number,
});
const PlayerSchema = new Schema({
/* other fields */
_gameLogs: {
type: [[GameLogSchema]],
},
});
This is what the data its supposed to deal with looks like -
Spreading one of these objects -