mongodb/mongo-ruby-driver — pull request #243 by estolfo (2013-08-08 11:51:10+00:00)
Title: RUBY-655 FindAndModify Operation class and specs

## Initial FindAndModify operation implementation
This pull request implements a basic class for defining a FindAndModify operation.

A FindAndModify object is created in certain update/remove terminator methods on Scope. For example,

collection.find( { :f_name => "emily" } ).update_one_then_get( { :$set => { :f_name => "Emily" } } )

will create a FindAndModify command and execute it.

### Scope additions
The methods on Scope that send a FindAndModify operation will be proposed in a separate pull request.

### Operation model
The interface for creating an Operation object and sending it to the cluster to be executed is not defined right now. I have defined a method #op that will simply create a hash representing the operation for now. It can easily be changed later on when Operation has been completely modeled.

### Exceptions
The Exception hierarchy is still undefined so an Exception is used in place of a more precise and meaningful class.

#### Note that yard documentaiton will be added later, after intial code review