a-musing-moose/morph — pull request #41 by chrsm (2012-08-11 20:31:13+00:00)
Title: Feature/save only changes

Hello, good tidings, and all that fun stuff!

I apologize in advance for borking the commits (merge into master from ... yadda), I tried to squash them into one and apparently I am not more of a git than git expects. But I digress.

Prior to now, Object::save() called Storage::save(), which ended up calling insert() no matter what.

I added functionality to update, as well as changed the Object::__getData method to accept a param that only returns 'new' or 'dirty' data.

When Storage::update() is called, it gets all the new or changed data, and sends it off to MongoDB using $set.

The unfortunate side effect of this is that embedded documents do not use $push or $pull. I will be working on that in the future.