以下是架构
const mongoose = require("mongoose");
const PatientFluidSchema = new mongoose.Schema(
{
patient: {
type: mongoose.Schema.Types.ObjectId,
ref: "Pateint",
required: true,
},
medicine: [
{
medicinename: {
type: String,
},
fluidquantity: {
type: String,
},
fluidtakentime: {
type: String,
},
},
],
},
{
timestamps: true,
}
);
module.exports = mongoose.model("PateintFluid", PatientFluidSchema);
我是NodeJS的新手,我被这个问题困住了.如何使用INSERTMANY查找具有患者ID的One并在医学中插入多个值