Search code examples
mongodbcsvmongoexport

mongoexport csv not exporting time


I am trying to export a collection to csv which has the following fields: _id number name price pollingTime

I can see the polling time data when I open the collection in RoboMongo or try to access the collection through mongoshell, but when I export that into a CSV, the pollingTime field comes out blank.

Here's my mongoexport command:

mongoexport --db=itemDB --collection=itemprice1 --type=csv --fieldFile=fields.txt --out items.csv

I need to send this data to some non-tech business folks; any idea if I need to make any changes in the fields.txt. Fields.txt is like this:

_id number name totalPrice pollingTimme


Solution

  • Apologies - I discovered immediately after while reviewing my question itself that I was making a mistake in the spelling of pollingTime field. I still want to keep the question and answer on StackOverflow so that others searching such a problem will try to look at their spellings :-)