def new(options = {})
      session = with(options)
      session.instance_variable_set(:@cluster, cluster.dup)
      if block_given?
        yield(session)
      else
        session
      end
    end
def new(options = {})
      session = with(options)
      session.instance_variable_set(:@cluster, cluster.dup)
      if block_given?
        yield(session)
      else
        session
      end
    end
Initialize a new database session.

 @example Initialize a new session.
   Session.new([ "localhost:27017" ])

 @param [ Array ] seeds An array of host:port pairs.
 @param [ Hash ] options The options for the session.

 @see Above options validations for allowed values in the options hash.

 @since 1.0.0
 Create a new session with +options+ and use new socket connections.

 @example Change safe mode
   session.with(write: { w: 2 })[:people].insert(name: "Joe")

 @example Change safe mode with block
   session.with(write: { w: 2 }) do |session|
     session[:people].insert(name: "Joe")
   end

 @example Temporarily change database
   session.with(database: "admin") do |admin|
     admin.command ismaster: 1
   end

 @example Copy between databases
   session.use "moped"
   session.with(database: "backup") do |backup|
     session[:people].each do |person|
       backup[:people].insert person
     end
   end

 @param [ Hash ] options The options.

 @return [ Session ] The new session.

 @see #with

 @since 1.0.0

 @yieldparam [ Session ] session The new session.