0
在MongoDB/NodeJs(帶Mongoose)中保存以下模式時出現此錯誤: 未捕獲RangeError:超出最大調用堆棧大小。MongoDB - NodeJs - 超出最大調用堆棧大小
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]
});
任何想法:
,當我在我的架構在陣列中添加細節會出現這種情況?
在此先感謝! Serge。
感謝了很多,但我也試過這個沒有成功:( – LucasBrazi06
我更新了消息,所以你可以用我的真實數據;-) – LucasBrazi06
我檢查看到。首先你確定這是工作'{type:String,ref:'ChargingStation'}'我剛剛看到一個對象id引用。那麼它不清楚'attributes'只意味着一個'Attribute'模式,還是它也是一個數組? –