julien-c/mongovel — pull request #32 by arthurdarcet (2014-11-21 12:37:07+00:00)
Title: Bulk operations

Bulk wrapper to provide a mongo-like interface over the mess php made of the MongoWriteBatch classes (with corresponding tests!)

Same interface than http://docs.mongodb.org/manual/reference/method/js-bulk/ :
```php
$bulk = Book::initializeOrderedBulk();

$bulk->insert(array('author' => 'Me', 'title' => 'My life'));

$bulk->find(array('author' => 'Me'))
->update(array('$push' => array('reviews' => "Awesome!")));

$bulk->find(array('title' => 'My life'))
->updateOne(array('$push' => array('reviews' => "Incredible!")));

$bulk->find(array('title' => 'My life, II'))
->upsert()
->update(array('$push' => array('reviews' => "Can't wait!")));

$bulk->find(array('author' => 'Not me'))
->remove();

$bulk->find(array('title' => 'My life, II'))
->removeOne();

$bulk->execute();
```