Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/powershell/11.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
您能否告诉我,如何在powershell中开发日期的参数化查询?_Powershell_Mongoexport - Fatal编程技术网

您能否告诉我,如何在powershell中开发日期的参数化查询?

您能否告诉我,如何在powershell中开发日期的参数化查询?,powershell,mongoexport,Powershell,Mongoexport,启动进程-文件路径“C:\Program Files\MongoDB\Tools\100\bin\mongoexport.exe”-ArgumentList'-db=rndDB--collection=Messages--type=csv--fields Name、Message、Address、Start_date、End_date-q”{“Start_date”:{“$gte”:{“$date”:“2021-02-02T22:30:00.000Z”},$lt:{“$date”:“2021-0

启动进程-文件路径“C:\Program Files\MongoDB\Tools\100\bin\mongoexport.exe”-ArgumentList'-db=rndDB--collection=Messages--type=csv--fields Name、Message、Address、Start_date、End_date-q”{“Start_date”:{“$gte”:{“$date”:“2021-02-02T22:30:00.000Z”},$lt:{“$date”:“2021-02-03T22:30:00.000Z”}”--out C:\Collection\Date\u r2.csv'

若要展开变量,必须将它们放在双引号中。我想您需要其他双引号,因此可以使用倒勾“:

或组合单引号字符串:

'-q "{"Start_date":{"'+$gte+'":{"'+$date+'":"2021-02-02T22:30:00.000Z"},"'+$lt+'":{"'+$date+'":"2021-02-03T22:30:00.000Z"} } }"' +
请此外,请更新您的问题,以详细说明什么不起作用以及预期的行为是什么。
'-q "{"Start_date":{"'+$gte+'":{"'+$date+'":"2021-02-02T22:30:00.000Z"},"'+$lt+'":{"'+$date+'":"2021-02-03T22:30:00.000Z"} } }"' +