我已经创建了一个NodeJS项目,用于在MongoDB中记录JSON对象,这是我的JAVA中的一部分。为了插入对象,我定义了JSON模式,并将其设置为Mongoose对象,如下所示。/model/TeslaProfileRequest_JSONSchema.json');
var stateSchema = new mongoose.Schema(stateModel)
在添加/更新记录之前,我希望每次都将动态字段添加到Mongoose中。此后,我将字段定义到单独的JSON文件中,并希望每次都将相同的JSON字段动态添加到Mongoose模式中。这是可能的吗?简单模式示例: title: String, // String is shorthand for {type