2016-05-19 6 views
0

Mongoデータベースをテキスト形式でエクスポートしたいと思います。私はUbuntu terminalを使用してコマンドを生成しますが、これは一般的に非常にうまく動作します。コマンドは次のようになります:Mongoデータベースフィールドをtxtにエクスポート

mongoexport --host localhost --db twitter-tweets-database --collection 
realtargettweetstable --csv --out /home/sulkhan/Desktop/oilprice.txt -- 
fields text,timestamp_ms 

私は、このコマンドを使用するときに私は、しかし、エラーが発生します。

mongoexport --host localhost --db twitter-tweets-database --collection 
realtargettweetstable --csv --out /home/sulkhan/Desktop/oilprice.txt 
--fields text,timestamp_ms,crude oil_sentiment 

エラーは言う:

ERROR: too many positional options

私の唯一の推測は誤りということですヘッダーによって引き起こされます:crude oil_sentiment。このヘッダー(フィールド)は、他のフィールドとは、原油と油の間のスペースだけが異なります。

このヘッダーはエラーなくエクスポートできますか?

答えて

2

crude oil_sentiment

crude\ oil_sentiment
mongoexport --host localhost --db twitter-tweets-database --collection 
realtargettweetstable --csv --out /home/sulkhan/Desktop/oilprice.txt 
--fields text,timestamp_ms,crude\ oil_sentiment 
を変更してみてください
関連する問題