我在使用MongoExport.exe执行日期范围搜索时遇到问题。它一直试图解析" 05-2017" as" 2006"。
C:\Program Files\MongoDB\Server\3.4\bin>mongoexport.exe /h servername /p 27017 /d database /c collection /q "{'received_time': { '$gte' : {'$date':'19-05-2017'}, '$lte' : {'$date':'20-05-2017'}}}"
2017-05-22T20:36:31.685+0100 error validating settings: parsing time "19-05-2017" as "2006-01-02T15:04:05Z07:00": cannot parse "5-2017" as "2006"
2017-05-22T20:36:31.686+0100 try 'mongoexport --help' for more information
但是,如果我在MongoDB Compass中运行以下命令,它将按预期执行:
{received_time: { $gte : {$date:"2017-05-19"}, $lte : {$date:"2017-05-20"}}}
非常感谢任何有关解决此问题的帮助!