noc.core.cache.mongo

Module Contents

class noc.core.cache.mongo.MongoCache

Bases: noc.core.cache.base.BaseCache

collection_name = noc.caches.mongo
KEY_FIELD = _id
VALUE_FIELD = v
EXPIRES_FIELD = x
classmethod get_collection(cls)
classmethod ensure_indexes(cls)

Create all necessary indexes. Called by ensure-index :return:

get(self, key, default=None, version=None)
set(self, key, value, ttl=None, version=None)

Set key :param key: :param value: :param ttl: :return:

delete(self, key, version=None)