MongoEngine 0.5 Released!

Hurray! MongoEngine 0.5 has finally been released!

With many improvements and bug fixes means that MongoEngine is more powerful than ever!

Core improvements include:

  • Efficient save
    Now when you save an existing object it atomically updates only what has been changed. Making it super efficient and so easy to use, without having to worrying about race conditions.
  • Efficient Database Referencing
    MongoEngine saves you queries by intelligently identifiying and dereferencing DBReference fields.
  • Complex fields
    Dictionary and List fields can store any complex data you require; other dictionaries, lists and other documents.
  • Signal support
    pre and post save / delete.
  • Subfield slicing
    For retrieving parts of subsets of lists, keeping data transfer down.
  • Abstract Base Classes
    Helps keep your document definitions dry so you can easily extend Documents.
  • Custom Object Managers
    When used with Astract Base Classes you can easily apply behaviour across all querysets.
  • query_counter
    A context manager, that helps you determine the cost of some queries / code - great for testing!

If you are using Flask - then check out our Flask-MongoEngine library, which provides MongoEngine connection and WTForms support.

With Multi Database support coming quickly in 0.6, we promise it wont take so long between release cycles!  Checkout the documentation to get you started!

 

Exciting changes in MongoEngine.

For the last few months at work we've been adopting MongoDB as our main database. For those that don't know what MongoDB is and you're still reading this?! "MongoDB is an open source, document-oriented database designed with both scalability and developer agility in mind. Instead of storing your data in tables and rows as you would with a relational database, in MongoDB you store JSON-like documents with dynamic schemas."

Coming from a Django background, MongoEngine "a Document-Object Mapper (think ORM, but for document databases) for working with MongoDB from Python" seemed a natural choice. Since joining the project, as well as fixing numerous bugs, we've added many new features to MongoEngine core.

Here are some of my favourites:

  • Added complex Dictionary / List fields - Which can store any complex data you require; other dictionaries, lists, references.
  • Signal support - pre and post save / delete.
  • Subfield slicing - for retrieving parts of subsets of lists.
  • Abstract Base Classes - Helps keep your document definitions dry
  • Custom Object Managers - When used with Astract Base Classes you can easily apply behaviour across all querysets.
  • Delta tracking - Now save on an existing object, atomically updates only what has been changed. Making it super efficient and so easy to use, without having to worrying about race conditions.
  • Select Related support - Now generic / reference fields can use select_related to minimise the number of queries to mongo.
  • query_counter - A context manager, that helps you determine the cost of some queries / code.

Some of the above, I'll blog about in more depth in the near future as especially the delta tracking is pretty cool.  In the near future the 0.5 release will be out - its on the dev branch if you want to play with it now.  With more ideas / suggestions for improvements being added to github, it seems that MongoEngine will only get better. So why not signup to the usergroup and join in the discussion.

Mongoengine