feliixx/mgodatagen

Option to send documents to stdout or to a file?

Closed this issue · 2 comments

Is there a command line switch or a config file option so that the generated documents are sent to stdout or to a file?

For prototyping documents it would be useful to not need to round-trip through a MongoDB database/collection. It would also be useful in situations when a MongoDB is temporarily unavailable due to maintenance, network non-availability, etc.

Hi @rickhg12hs,

I added the possibility to write the document to a json file or to stdout directly ( see mgodatagen v0.9.5

you can use it by specifying the -o | --output flag, for example:

./mgodatagen -f config.json -o /tmp/n.json

Works great! Thanks!