skip to navigation
skip to content

mongowriter 0.1.3

Adapter to write documents from a queue to mongodb concurrently

Latest Version: 0.1.7

MongoWriter provides a simple interface to write documents to a mongodb replica set. The interface is an object which behaves like a queue, MongoWriter being the consumer. It tries to handle mongo exceptions (like primary change) gracefully, only dropping documents if the input queue gets full. This is to make a best effort to insert the latest documents in the face of overload or errors but can be disabled by using an unlimited queue.


By default MongoWriter uses Threads for its insert workers. Using monkey patches, it works with greenlets as well.

Input Queue

The input object passed to MongoWriter can be anything that acts like a Python queue. The items in the queue are expected to be (collection_name, document) tuples. There is a queue adaptation in mongowriter.util which can be useful for high troughput writing to capped collections.

File Type Py Version Uploaded on Size
mongowriter-0.1.3.tar.gz (md5) Source 2014-05-28 2KB