The panko.storage.impl_mongodb Module

MongoDB storage backend

class panko.storage.impl_mongodb.Connection(url, conf)

Bases: panko.storage.pymongo_base.Connection

Put the event data into a MongoDB database.

CONNECTION_POOL = <panko.storage.mongo.utils.ConnectionPool object>
clear()

Clear database.

clear_expired_data(ttl, max_count=None)

Clear expired data from the backend storage system.

Clearing occurs according to the time-to-live.

Parameters
  • ttl – Number of seconds to keep records for.

  • max_count – Number of records to delete (not used for MongoDB).

static update_ttl(ttl, ttl_index_name, index_field, coll)

Update or create time_to_live indexes.

Parameters
  • ttl – time to live in seconds.

  • ttl_index_name – name of the index we want to update or create.

  • index_field – field with the index that we need to update.

  • coll – collection which indexes need to be updated.

upgrade()

Migrate the database to version or the most recent version.