I have a MongoExport that looks like this:
mongoexport
-vv -h mongodb -d database-c collection-q“{‘blah.DateCreated’:{‘$gt’:new
Date(1345006800000),’$lt’:new Date(1347771600000)}}" -f_id,field1,field2.0.Price,field2.0.DateCreated,field2.1.Price,field2.1.DateCreated,field2.2.Price,field2.2.DateCreated,field2.3.Price,field2.3.DateCreated,field2.4.Price,field2.4.DateCreated,field2.5.Price,field2.5.DateCreated --csv
-o dataexport.csv
Is there any way to change the export so that it will export the sub-document fields for field2 in however many sub-documents exist? Something like:
mongoexport -vv -h mongodb -d database-c collection-q“{‘blah.DateCreated’:{‘$gt’:new Date(1345006800000),’$lt’:new Date(1347771600000)}}" -f_id,field1,field2.?.Price,field2.?.DateCreated --csv -o dataexport.csv