skip to navigation
skip to content

bottle-mongo 0.3.0

MongoDB integration for Bottle

This bottle-mongodb plugin integrates MongoDB with your Bottle application. It injects a MongoDB session in your route and handle the session cycle.

Support pymongo 3 and 2

Usage Example:

from bottle import Bottle ,redirect
from bottle.ext.mongo import MongoPlugin

from bson.json_util import dumps

app = Bottle()
plugin = MongoPlugin(uri="mongodb://", db="mydb", json_mongo=True)

@app.route('/', method='GET')
def index(mongodb):
    return dumps(mongodb['collection'].find())

@app.route('/create/', method='POST')
def create(mongodb):
    mongodb['collection'].insert({'a': 1, 'b': 2})
File Type Py Version Uploaded on Size
bottle-mongo-0.3.0.tar.gz (md5) Source 2015-05-13 3KB