0
這是我的架構:如何訪問貓鼬中的對象屬性?
var userSchema = new mongoose.Schema({
username: String,
total: {
avg_time: Number,
avg_guesses: Number,
guessed: Number
}
});
我想創建一個收集和avg_time,設置屬性avg_guesses和avg_guessed 0 我想這個代碼,但它不工作。
var user_data = new userSchema({username: usernames[i], total.avg_time: 0, total: avg_guesses: 0, total: guessed: 0});