:py:mod:`flow.record.adapter.mongo` =================================== .. py:module:: flow.record.adapter.mongo Module Contents --------------- Classes ~~~~~~~ .. autoapisummary:: flow.record.adapter.mongo.MongoWriter flow.record.adapter.mongo.MongoReader Functions ~~~~~~~~~ .. autoapisummary:: :nosignatures: flow.record.adapter.mongo.parse_path Attributes ~~~~~~~~~~ .. autoapisummary:: flow.record.adapter.mongo.__usage__ .. py:data:: __usage__ :value: Multiline-String .. raw:: html
Show Value .. code-block:: python """ MongoDB adapter --- Write usage: rdump -w mongo://[IP]:[PORT]/[DBNAME]/[COLLECTION] Read usage: rdump mongo://[IP]:[PORT]/[DBNAME]/[COLLECTION] [IP]:[PORT]: ip and port to a mongodb instance [DBNAME]: database name to write to or read from [COLLECTION]: collection to write to or read from """ .. raw:: html
.. py:function:: parse_path(path) .. py:class:: MongoWriter(path, key=None, **kwargs) Bases: :py:obj:`flow.record.adapter.AbstractWriter` .. py:attribute:: client .. py:method:: write(r) Write a record. .. py:method:: flush() Flush any buffered writes. .. py:method:: close() Close the Writer, no more writes will be possible. .. py:class:: MongoReader(path, selector=None, **kwargs) Bases: :py:obj:`flow.record.adapter.AbstractReader` .. py:attribute:: client .. py:method:: close() Close the Reader, can be overriden to properly free resources. .. py:method:: __iter__() Return a record iterator.