[英]Use custom function in default of schema?
我有一個這樣的架構:
new mongoose.Schema({
name: String,
uniq: {type: String, default: Math.random() + "a"},
})
我不能隨機,但對於uniq字段只能為null
默認情況下可以使用自定義功能嗎?
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.