3
默認我想要做這樣的事情:定義功能在一個領域中貓鼬
var categorySchema = new Schema({
id: {
unique: true,
default: function() {
//set the last item inserted id + 1 as the current value.
}
},
name: String
});
這是更多鈔票?
您將如何使用它? – aiapatag
例如我可以使用另一個值作爲參考設置id值而無需干預,每次添加新值時都可以。 –