0
我想限定日提交的「行」作爲值的陣列,其可以是不同類型(數字或字符串或布爾或日期)Mongoose數據類型如何定義多個類型值? ESLint錯誤
當我嘗試的:
lines: [
{
type: String,
content: Mixed
}
]
我得到一個錯誤ESLint錯誤:混合沒有定義
我應該寫?
const Schema = mongoose.Schema;
...
lines: [
Schema.Types.Mixed
]
使用混合模式類型,我認爲應該型混合 –