search

Home  >  Q&A  >  body text

mongodb - mongo 的 mongoexport

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里就报错。。。。。

麻烦知道的童鞋指导下

曾经蜡笔没有小新曾经蜡笔没有小新2789 days ago770

reply all(1)I'll reply

  • 迷茫

    迷茫2017-05-02 09:24:01

    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

    reply
    0
  • Cancelreply