1
這是我的用戶模式:如何爲嵌套的Mongoose文檔設置select = false?
var userSchema = mongoose.Schema({
profile: {
username: { type: String, required: true, unique: true },
role: String
},
auth: {
hashedPassword: { type: String, required: true },
facebookToken: String,
twitterToken: String,
googleToken: String
},
});
我想設置select = false
整個auth
對象。我會怎麼做?
謝謝!我確認了[此代碼](https://gist.github.com/adamzerner/f7007d03a18c8dff0223)。 –
當我在auth.type模式中存儲類型Number時,它將數字值存儲爲一個字符串。可以幫我解決這個問題。 –