hjespers/teslams — pull request #2 by dirkhh (2013-07-31 16:08:12+00:00)
Title: Add support to stream to a MongoDB database

This modifies streaming.js to switch to 'database mode' if the --db option is
given. In that case we add the streamed data to a local MongoDB database. The
mongodb JS module needs to be available (but is only required if the --db
option is given).

In order to do this the '.pipe(...)' method was replaced with '.on('data',...)'
which appears to be functionally equivalent (but I worry if there are subtle
differences).

Signed-off-by: Dirk Hohndel