【发布时间】:2017-09-02 04:39:03
【问题描述】:
在 MongoDB/NodeJs(使用 Mongoose)中保存以下架构时出现此错误: 未捕获的 RangeError:超出最大调用堆栈大小。
当我在数组中的架构中添加详细信息时会发生这种情况:
var mongoose = require('mongoose');
const Attribute = new mongoose.Schema({
context: String,
format: String,
measurand: String,
location: String,
unit: String
});
const Value = new mongoose.Schema({
value: Number,
attributes: Attribute
});
module.exports = mongoose.model('MeterValue',{
chargeBoxID: {type: String, ref: 'ChargingStation'},
connectorId: Number,
transactionId: Number,
timestamp: Date,
values: [Value]
});
有什么想法吗?
提前致谢! 塞尔吉。
【问题讨论】: