Hello,
I tried to export some documents from a specific collection and save it as an CSV file with the fieldnames in first line.
I use the command line and following code:
mongoexport --db DBNAME --collection collectionNAME --query
'{$text:{$search:"SEARCH-EXPRESSION"}}' --type=csv --fields
field1,field2,field3,field4 --fieldFile file.csv
This throws everytime following error message:
error validating settings; query ''{$text:{$search:"SEARCH-EXPRESSION"}}'' is not valid JSON: json:cannot unmarshal string into Go value of type map[string]interface {}
How can I fix this?
Thank you very much in advance for your help and advice.