mongoose boolean code example
Example 1: mongoose type boolean default false
isUsed: {
type: Boolean,
default: false
}
Example 2: array schema mongoose
const ToySchema = new Schema({ name: String });
const ToyBoxSchema = new Schema({
toys: [ToySchema],
buffers: [Buffer],
strings: [String],
numbers: [Number]
// ... etc
});