A CodeIgniter active record library for MongoDB

This evening I started work on an active record inspired library for interacting with MongoDB via a CodeIgniter library.

So far I’ve got searching and inserting working. Updating and deleting are going to take more time because they’re a bit trickier.

What this means is you can easily work with a database collection like so:

$this->mongo_db->where_gte('age', 18)->where(array('country' => 'UK', 'can_drink' => TRUE))->get('people');


$this->mongo_db->get_where('posts', array('title' => 'Hello, World!');

Or just:


I’ve created a repository on Bitbucket located at http://bitbucket.org/alexbilbie/codeigniter-mongo-library. If you have a look at the README file there is an overview of what is there so far and also what needs doing (and some maybes!).

Hope people find it useful.