backends.mongodb

MongoDB result store backend.

Module Contents

Classes

InvalidDocument()
MongoBackend(self,app=None,**kwargs) MongoDB result backend.
class InvalidDocument
class MongoBackend(app=None, **kwargs)

MongoDB result backend.

Raises:
celery.exceptions.ImproperlyConfigured:
if module :pypi:`pymongo` is not available.
__init__(app=None, **kwargs)
_prepare_client_options()
_get_connection()

Connect to the MongoDB server.

encode(data)
decode(data)
_store_result(task_id, result, state, traceback=None, request=None, **kwargs)

Store return value and state of an executed task.

_get_task_meta_for(task_id)

Get task meta-data for a task by id.

_save_group(group_id, result)

Save the group result.

_restore_group(group_id)

Get the result for a group by id.

_delete_group(group_id)

Delete a group by id.

_forget(task_id)

Remove result from MongoDB.

Raises:
pymongo.exceptions.OperationsError:
if the task_id could not be removed.
cleanup()

Delete expired meta-data.

__reduce__(args=tuple, kwargs=dict)
_get_database()
database()

Get database from MongoDB connection.

performs authentication if necessary.

collection()

Get the meta-data task collection.

group_collection()

Get the meta-data task collection.

expires_delta()
as_uri(include_password=False)

Return the backend as an URI.

Arguments:
include_password (bool): Password censored if disabled.