Я использую
- MySQL Workbench
- Node.js с Knex.js
Мои данные в SQL выглядят так:
+--------------+----+--------------------+
| date | id | happinessIndicator |
+--------------+----+--------------------+
| '2019-10-20' | 1 | happy |
| '2019-10-20' | 2 | happy |
| '2019-10-20' | 3 | happy |
| '2019-10-20' | 4 | happy |
+--------------+----+--------------------+
Это мой код для получения голосов за текущий день
exports.day = function (req, res) {
const today = moment().format('YYYY-MM-DD');
knex('votes')
.where('date', today)
.then(function (resp) {
res.json({
status: true,
message: 'ok',
data: resp
})
})
.catch(function (error) {
res.json(
{
status: false,
msg: error.code
}
)
})
};
, но мой результат выглядит так:
![enter image description here](https://i.stack.imgur.com/zERQ5.png)
Почему он не возвращает 2019-10-20
как там хранится?