prisma2 - Prisma 2 无法获取具有空值的 DateTime 列
问题描述
await this.prisma.fee_collections.findMany({
where: whereClauseWithTransactionDateCondition,
include: {
student_master: {
select: {
fee_start_month: true,
}
}
}
});
在我的数据库中, fee_start_month 列架构:
fee_start_month 日期时间?@db.日期
在 fee_start_month 列中,一些值为空,因此 prisma2 无法获取这些记录,并引发异常。
生成的错误:[Nest] 21275 - 2021 年 3 月 15 日,13:09:21 [ExceptionsHandler] 无效prisma.fee_collections.findMany()
调用:
值超出类型的范围。该列fee_start_month
包含无效的 DateTime 值,其中日或月设置为零。+3337 毫秒
解决方案
推荐阅读
- java - 如何每 2 分钟触发一次服务
- php - 如何从 Laravel 中没有关系的 eloquent 中排除记录?
- javascript - Web Audio API - 无法播放简单的音频
- r - Tensorflow(在 R 中)找不到 libcudart.so.11.0
- angular - api调用后如何加载mdbCharts中的数据?
- python - Pandas:如何删除具有单列不同值的重复项,同时保留所述不同值
- flutter - flutter platformview无法在potrait模式下设置videoview
- performance - 性能问题 - 使用 Nuxt.js 显示动态 HTML 表格
- python - 有没有办法使用 ftplib 找到 FTP 服务器中的剩余空间?
- java - 每当在 CMD/Shell 中运行“java”命令时都会附加未知输出