mongoose:无法投射ISOdate

我有个约会:

2016-04-13T09:57:21-04

除非我不正确,否则这是一种有效的ISO格式 ,但是我得到了Mongoose的转换错误:

“投射date失败的值\”2016-04-13T09:57:21-04 \“在path\”时间戳\“”

我看了一些其他的SOpost ,从我的理解,有效的ISO格式应该工作。

我在这里错过了什么?

您需要首先将此string转换为Date对象。 Mongoose期望date而不是string。