minimalkv.db.mongo module

class minimalkv.db.mongo.MongoStore(db, collection)

Bases: KeyValueStore

Uses a MongoDB collection as the backend, using pickle as a serializer.

Parameters

db :

An authenticated pymongo database.

collectionstr

A MongoDB collection name.

iter_keys(prefix: str = '') Iterator[str]

Iterate over all keys in the store starting with prefix.

Parameters

prefixstr, optional, default = ‘’

Only iterate over keys starting with prefix. Iterate over all keys if empty.

Raises

IOError

If there was an error accessing the store.