-
Type: Question
-
Resolution: Works as Designed
-
Priority: Trivial - P5
-
None
-
Affects Version/s: 3.4.7
-
Component/s: mongoexport
-
None
-
Environment:Win8.1x64
I wanted to export a array to a csv file using mongoexport utility without mentioning the Index number.
E.g. mongoexport -d test -c tech --type=csv --out fields_tech.csv --fields skills.0,skills.1
From above example am using something like skills.0,skills.1
Since i know the length of the array am able to give the index values for export.
In few cases the length of the array is so big i cannot give the index number while exporting.
Is there any way to import all the array values to a csv without mentioning the index numbers.
Array:
"skills" : [ "java","dotnet","testing" ]
Expected output
skills
java
dotnet
testing
I have tried $unwind option but wanted to know if it is possible directly using mongoexport