Eksempelkode til at skabe Array af arrays af objekter:
const cellSchema = new mongoose.Schema({
type: String,
count: Number
});
const matrixSchema = new mongoose.Schema({
matrix: [[cellSchema]]
});
const Matrix = mongoose.model('Matrix', matrixSchema);
const newMatrix = new Matrix({
matrix: [
[{ type: 'xyz', count: 10 }, { type: 'ABC', count: 20 }],
[{ type: 'pqr', count: 10 }]]
});
newMatrix.save();