how to store array in mongoose schema code example
Example 1: js array of strings mongoose
var personSchema = new mongoose.Schema({
tags: [{
type: String
}]
Example 2: array schema mongoose
const ToySchema = new Schema({ name: String });
const ToyBoxSchema = new Schema({
toys: [ToySchema],
buffers: [Buffer],
strings: [String],
numbers: [Number]
// ... etc
});