所以我有以下模式:
const UserSchema = new mongoose.Schema({
name: { type: String, required: true },
organization: { type: mongoose.Schema.Types.ObjectId, ref: "Org" },
clocks: [
{
date: { type: Date, default: Date.now },
lunch: Boolean,
in: Boolean
}
]
});
我希望Clocks数组上的“ in”值与默认值交替显示。
(真,假,真,假等)
我怎么用猫鼬设置它?