ido50/MongoDBx-Class — pull request #4 by tmueller (2012-07-05 00:38:12+00:00)
Title: Add support for document attributes which are not to be saved in the database.

Hello Ido,

I implemented the feature in the title from the TODO-List on CPAN.

The trait for the attribute is called "Transient" and means, that an attribute can be used as a usual Moose-attribute, but it will not be saved to the database. I therefore edited the collapse and expand -methods in MongoDBx::Class::Connection to simply skip attributes, having the Transient-trait.

The only thing, I do not fully understand, is why inserting a transient attribute does not insert the value hard into the database. Because the insert-method is not overwritten or modified in MongoDBx::Class::Collection. Although I don't understand the reason for this, it is intended behaviour.

I also implemented a few tests. Missing is a test, that tests for not expanding a value, that is already present in the database. That is because I could not insert the transient attribute.

Maybe you can review the added code and merge it into the official MongoDBx::Class repo or just tell me, what has yet to be changed.

Cheers,
Thomas