def with(new_options = Options::Redacted.new)
      clone.tap do |client|
        opts = validate_options!(new_options)
        client.options.update(opts)
        Database.create(client)
        # We can't use the same cluster if some options that would affect it
        # have changed.
        if cluster_modifying?(opts)
          Cluster.create(client)
        end
      end
    end
def with(new_options = Options::Redacted.new)
      clone.tap do |client|
        opts = validate_options!(new_options)
        client.options.update(opts)
        Database.create(client)
        # We can't use the same cluster if some options that would affect it
        # have changed.
        if cluster_modifying?(opts)
          Cluster.create(client)
        end
      end
    end
Creates a new client with the passed options merged over the existing
 options of this client. Useful for one-offs to change specific options
 without altering the original client.

 @note Depending on options given, the returned client may share the
   cluster with the original client or be created with a new cluster.
   If a new cluster is created, the monitoring event subscribers on
   the new client are set to the default event subscriber set and
   none of the subscribers on the original client are copied over.

 @example Get a client with changed options.
   client.with(:read => { :mode => :primary_preferred })

 @param [ Hash ] new_options The new options to use.

 @return [ Mongo::Client ] A new client instance.

 @since 2.0.0