Skip to main content
This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (
Help us improve Python packaging - Donate today!

livedata for MongoDB, similar to RDBM triggers or meteorjs livedata

Project Description

What is this?

mongodb-triggers is a light-weight library to allow real live changes notification. This is similar to triggers in SQL. This capability can be found both in Java and JavaScript(MeteorJS)

What is it good for?

Modern applications have become near real-time response and updates, this leads to the requirement that any changes done in the data to be propagated up to the top level of the application as soon as possible.

In order to allow this to happen, any changes in the databases must be notified, similar project that use this method is

More Documentation can be found at


Installer is available on PyPI. You can install it through pip:

$ pip install mongotriggers

Why should I use it?

The best functionality is the one that another one is maintaining for you, as well as 100% code coverage. This package follows best practices as published by MongoDB: - -

How to use?

Let’s assume the system in development is a financial one, and every deletion in the database is extremely important, so we would like to notified for each deletion.

from mongotriggers import MongoTrigger
from pymongo import MongoClient

def notify_manager(op_document):
    print ('wake up! someone is adding me money')

client = MongoClient(host='localhost', port=27017)
triggers = MongoTrigger(conn)
triggers.register_op_trigger(notify_manager, 'my_account', 'my_transactions')

client['my_account']['my_transactions'].insert_one({"balance": 1000})

Keep in mind that it is meant to run in a defered context in order to run endlessly until it is cancelled.


In order to develop, the additional requirements are:

  • pytest
  • pytest-cov
  • tox

All packages can be installed using pip. The easiest way to run the tests is to run tox.

Release History

Release History

This version
History Node


History Node


History Node


History Node


Download Files

Download Files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
mongotriggers-2.0.1-py2.py3-none-any.whl (7.6 kB) Copy SHA256 Checksum SHA256 py2.py3 Wheel Apr 20, 2017
mongotriggers-2.0.1.tar.gz (13.0 kB) Copy SHA256 Checksum SHA256 Source Apr 20, 2017

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting