crodas/activemongo

There is no license information available for the latest version (dev-master) of this package.

Simple and efficient ActiveRecord data abstraction for MongoDB

dev-master 2012-09-11 06:09 UTC

This package is auto-updated.

Last update: 2024-12-12 18:52:33 UTC


README

Really simple Activedocument for MongoDB
----------------------------------------

MongoDB is a very powerful database, high performance and amicable. I wrote an article about it,

http://www.phpclasses.org/blog/post/118-Developing-scalable-PHP-applications-using-MongoDB.html

ActiveMongo, is a simple yet efficient MongoDB abstraction, following the Activedocument pattern. Visit http://crodas.org/activemongo.php for further details.

Comments, patches, bug reports are welcome to the blog post, my personal e-mail address, crodas@php.net 


 What it does now:

- Handle MongoDB connection, connecting once when it is needed
- Define a Collection as a class
- Abstracts iteration over a dataset
- Efficient save() which creates or updates efficiently (using $unset, $set) a document
- Provides simple queries interface, but allows to get MongoCollection for complex queries in sub-classes
- Delete current object, Drop() table
- Support filtering per property
- Support for efficient updates on nested documents
- Support Hooks:
    - pre_save($operation, Array &$document): Right before to perform and insert or update
    - on_save(): When a document is created
    - on_update(): When a document is updated
    - on_iterate(): On iteration, when the cursor moves to the next document
- Support simple yet useful collection installation, useful to create indexes and shard keys.
- Efficient references to another document, and an efficient way to load it (with one query if possible)
- Dynamic References (AKA, save a query to execute later)

TODO:

- PHP Streams support for GridFS
- Tools for setup and manage a sharded environment