skip to navigation
skip to content

Not Logged In

minimongo 0.2.8

Minimal database Model management for MongoDB


Info:Minimal database Model management for MongoDB.
Author:Steve Lacy (


minimongo is a lightweight, schemaless, Pythonic Object-Oriented interface to MongoDB.

It provides a very thin, dynamicly typed (schema-less) object management layer for any data stored in any MongoDB collection. minimongo directly calls the existing pymongo query syntax.

minimongo can easily layer on top of existing MongoDB collections, and will work properly with almost any existing schema, even from third party applications.


If you have setuptools you can use easy_install -U minimongo. Otherwise, you can download the source from GitHub and run python install.


  • pymongo 1.9+
  • sphinx (optional – for documentation generation)


Here’s a very brief example of creating an object, querying for it, modifying a field, and then saving it back again:

from minimongo import Model, Index

class Foo(Model):
    class Meta:
        # Here, we specify the database and collection names.
        # A connection to your DB is automatically created.
        database = "minimongo"
        collection = "rocks"

        # Now, we programatically declare what indices we want.
        # The arguments to the Index constructor are identical to
        # the args to pymongo"s ensure_index function.
        indices = (

if __name__ == "__main__":
    # Create & save an object, and return a local in-memory copy of it:
    foo = Foo({"x": 1, "y": 2}).save()

    # Find that object again, loading it into memory:
    foo = Foo.collection.find_one({"x": 1})

    # Change a field value, and save it back to the DB.
    foo.other = "some data"

Feedback welcome!

Please email with comments, suggestions, or comment via

File Type Py Version Uploaded on Size
minimongo-0.2.8.tar.gz (md5) Source 2012-10-31 14KB
  • Downloads (All Versions):
  • 68 downloads in the last day
  • 248 downloads in the last week
  • 1375 downloads in the last month