wsgidav.samples.mongo_dav_provider#

Description

Implementation of a WebDAV provider that provides a very basic, read-only resource layer emulation of a MongoDB database.

Usage: add the following entries to wsgidav.conf:

from wsgidav.samples.mongo_dav_provider import MongoResourceProvider
mongo_dav_opts = {}
addShare("mongo", MongoResourceProvider(mongo_dav_opts))

Valid options are (sample shows defaults):

opts = {"host": "localhost",       # MongoDB server
        "port": 27017,             # MongoDB port
        # This options are used with `mongod --auth`
        # The user must be created in the admin db with
        # > use admin
        # > db.addUser(user_name, password)
        "user": None,              # Authenticate with this user
        "pwd": None,               # ... and password
        }

Classes

CollCollection(path, environ, coll)

Mongo collections, contains mongo documents.

ConnectionCollection(path, environ)

Root collection, lists all mongo databases.

DbCollection(path, environ)

Mongo database, contains mongo collections.

DocResource(path, environ, doc)

Mongo document, returned as virtual text resource.

MongoResourceProvider(options)

DAV provider that serves a MongoDB structure.

Other Members