You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to use the writer to output a CSV file. I have a list of objects that I'm processing with another part of my application and periodically I want to write the data out from those objects as they complete.
At the moment i'm simply doing a csvwriter.write(object) having already wired up the stream. When I do this, I get all the fields on the object correctly, however I then get all the methods that have been attached to the object prototype as well. A simplistic example of this is below:
Which isn't expected. I've tried tracking this through to the write function but must confess I'm not really clear on what that's actually doing in this case...
Searching the docs, it doesn't appear I can limit the fields that are being passed which would get me sorted - however, it feels very brittle to me to taking the object, dumping just the keys I want and then passing that to the writer as that is a point of maintenance that will need to be kept in sync with original object.
The text was updated successfully, but these errors were encountered:
I'm trying to use the writer to output a CSV file. I have a list of objects that I'm processing with another part of my application and periodically I want to write the data out from those objects as they complete.
At the moment i'm simply doing a
csvwriter.write(object)
having already wired up the stream. When I do this, I get all the fields on the object correctly, however I then get all the methods that have been attached to the object prototype as well. A simplistic example of this is below:If you run this you'll get something approximating the following output:
Which isn't expected. I've tried tracking this through to the
write
function but must confess I'm not really clear on what that's actually doing in this case...Searching the docs, it doesn't appear I can limit the fields that are being passed which would get me sorted - however, it feels very brittle to me to taking the object, dumping just the keys I want and then passing that to the writer as that is a point of maintenance that will need to be kept in sync with original object.
The text was updated successfully, but these errors were encountered: