Split write operations into a specified number of children operations

Not the prettiest bit of code but I need this for the Bulk API:
If a write operation is too large to send, I'll want to split it into multiple children operations to be sent individually instead.

Thanks guys =) I don't want this method to be available to any other ops
besides WRITE::DELETE, WRITE::UPDATE, WRITE::INSERT. Ideas on how I can do
that?


On Wednesday, July 9, 2014, Durran Jordan <notifications@github.com
<javascript:_e(%7B%7D,'cvml','notifications@github.com');>> wrote:

> In lib/mongo/operation/write/delete.rb:
>
> > @@ -101,6 +101,31 @@ def merge!(other)
> >            self
> >          end
> >
> > +        # Split this operation into the specified number of children operations.
> > +        #
> > +        # @params [ Integer ] divisor The number of children operations to split
> > +        #   this one into.
> > +        #
> > +        # @return [ Array ] An array of children operations.
> > +        #
> > +        # @since 2.0.0
> > +        def split(divisor)
>
> You beat me to it! :)
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/mongodb/mongo-ruby-driver/pull/452/files#r14714961>.
>


-- 
Sent fom form my phnone