mongodb - mongo 的 mongoexport
曾经蜡笔没有小新
曾经蜡笔没有小新 2017-05-02 09:22:01
0
1
763
mongoexport -h 192.168.1.8 -d video -c movie --query {\$and:[{site:{\$size:1}},{title:1}]} -f id,title --csv -o /log/mongo/1.csv

我在执行Mongoexport 老是报错 ,too many positional arguments: [{title:1}]]

但我单独去执行这个query的时候是有数据的,不知道为什么放在mongoexport里就报错。。。。。

麻烦知道的童鞋指导下

曾经蜡笔没有小新
曾经蜡笔没有小新

reply all(1)
迷茫

What operating system? This is mainly a problem of escaping special characters. There is probably something wrong with the system recognition of the braces you have here. Try changing it to the following:

mongoexport -h 192.168.1.8 -d video -c movie --query "{$and:[{site:{$size:1}},{title:1}]}" -f id,title --csv -o /log/mongo/1.csv
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template