MEZ*_*UBI 3 date mongodb robo3t
试过很多格式,如:
manufactureDate : new Date("2009-8-2"),
Run Code Online (Sandbox Code Playgroud)
要么
manufactureDate : new Date(2009,8,2),
Run Code Online (Sandbox Code Playgroud)
甚至
manufactureDate : new Date("Feb 8, 2009"),
Run Code Online (Sandbox Code Playgroud)
每个验证尝试都以:
Unable to parse JSON
Run Code Online (Sandbox Code Playgroud)
有任何想法吗?
在robomongo当你右键点击集合名称,然后点击Insert documents... 弹出新窗口打开,如果插入dates下面,然后点击保存按钮,然后它显示错误Unable to parse JSON,因为robomongo不知道new Date()在插入文档视图功能.这考虑JSON而{manufactureDate : new Date(2009,8,2)}不是有效的JSON格式.所以不要dates使用Insert documents...use direct mongo命令插入

使用查询插入日期以运行此查询press(ctrl + enter):
这将以ISODate格式插入日期.