Кажется, что моя функция .findOne работает так, как должна, но мне кажется, что я чего-то упустил.Он отображает учетные записи с именем пользователя, которое я ввел, но полностью игнорирует поле Пароль.
exports.accountLogin = (req, res) => {
Accounts.findOne({Username: 'Test', Password: 'Password'}, (err, account) => {
if (err) return next(err);
res.send(account)
});
Вот моя схема учетных записей
const AccountsSchema = new Schema({
Username: {
type: String,
required: true,
max: 8,
},
Password: {
type: String,
required: true,
max: 10,
},
AccountType: {
type: String,
required: true,
max: 100,
},
Email: {
type: String,
required: true,
max: 35,
},
Age: {
type: Number,
required: true,
max: 100,
},
Question1A: {
type: String,
required: true,
max: 100,
},
Question2A: {
type: String,
required: true,
max: 100,
},
Question3A: {
type: String,
required: true,
max: 100,
},
});
};