ScyllaDB University Live | Free Virtual Training Event
Learn more
ScyllaDB Documentation Logo Documentation
  • Deployments
    • Cloud
    • Server
  • Tools
    • ScyllaDB Manager
    • ScyllaDB Monitoring Stack
    • ScyllaDB Operator
  • Drivers
    • CQL Drivers
    • DynamoDB Drivers
    • Supported Driver Versions
  • Resources
    • ScyllaDB University
    • Community Forum
    • Tutorials
Install
Search Ask AI
ScyllaDB Docs ScyllaDB Node.js Driver API Reference Classes HostMap

HostMap¶

HostMap()

Represents an associative-array of hosts that can be iterated. It creates an internal copy when adding or removing, making it safe to iterate using the values() method within async operations.

Constructor¶

new HostMap()

Source

host.js, line 152

Extends¶

  • events.EventEmitter

Methods¶

clear()

Source

host.js, line 239

Deprecated

Not supported by the driver. Usage will throw an error.

forEach(callback)

Executes a provided function once per map element.

Parameters:
Name Type Description
callback

Source

host.js, line 178

get(key) → {Host}

Gets a host by key or undefined if not found.

Parameters:
Name Type Description
key String

Source

host.js, line 190

Returns:
Type
Host

keys() → {Array:.<String:>}

Returns an array of host addresses.

Source

host.js, line 198

Returns:
Type
Array:.<String:>

remove()

Source

host.js, line 205

Deprecated

Not supported by the driver. Usage will throw an error.

removeMultiple()

Source

host.js, line 212

Deprecated

Not supported by the driver. Usage will throw an error.

set()

Source

host.js, line 219

Deprecated

Not supported by the driver. Usage will throw an error.

values() → {Array:.<Host:>}

Returns a shallow copy of the values of the map.

Source

host.js, line 227

Returns:
Type
Array:.<Host:>

(package, static) fromRust(hostsList)

Converts a list of HostWrapper from Rust to a HostMap

Parameters:
Name Type Description
hostsList Array:.<_rust.HostWrapper:>

Source

host.js, line 256

Was this page helpful?

PREVIOUS
Host
NEXT
LineString
  • Create an issue
  • Edit this page

On this page

  • HostMap
    • Constructor
    • Extends
    • Methods
ScyllaDB Node.js Driver
Search Ask AI
  • main
    • main
  • API Reference
    • Modules
      • auth
        • AuthProvider
        • Authenticator
        • PlainTextAuthProvider
      • concurrent
      • datastax
      • errors
        • ArgumentError
        • AuthenticationError
        • BusyConnectionError
        • DriverInternalError
        • NoHostAvailableError
        • NotSupportedError
        • OperationTimedOutError
        • ResponseError
      • geometry
      • mapping
        • DefaultTableMappings
        • Mapper
        • ModelBatchItem
        • ModelMapper
        • Result
        • UnderscoreCqlToCamelCaseMappings
        • TableMappings
      • metadata
        • Aggregate
        • ClientState
        • ColumnMetadata
        • Index
        • KeyspaceMetadata
        • MaterializedView
        • Metadata
        • SchemaFunction
        • Strategy
        • TableMetadata
        • UdtField
        • UserDefinedType
      • metrics
        • DefaultMetrics
        • ClientMetrics
      • policies
        • addressResolution
          • AddressTranslator
          • EC2MultiRegionTranslator
          • MappingAddressTranslator
        • loadBalancing
          • AllowListPolicy
          • DCAwareRoundRobinPolicy
          • DefaultLoadBalancingPolicy
          • LegacyDefaultLoadBalancingPolicy
          • LoadBalancingConfig
          • LoadBalancingPolicy
          • RoundRobinPolicy
          • TokenAwarePolicy
        • reconnection
          • ConstantReconnectionPolicy
          • ExponentialReconnectionPolicy
          • ReconnectionPolicy
        • retry
          • FallthroughRetryPolicy
          • RetryPolicy
        • speculativeExecution
          • ConstantSpeculativeExecutionPolicy
          • NoSpeculativeExecutionPolicy
          • SpeculativeExecutionPolicy
        • timestampGeneration
          • MonotonicTimestampGenerator
          • TimestampGenerator
      • tracker
        • RequestLogger
        • RequestTracker
      • types
        • Duration
        • InetAddress
        • Integer
        • LocalDate
        • Long
        • ResultSet
        • ResultStream
        • Row
        • TimeUuid
        • Vector
    • Classes
      • AddressResolver
      • ByteOrderedToken
      • Client
      • Encoder
      • EncoderMembers
      • ExecutionOptions
      • ExecutionProfile
      • FrameReader
      • HashSet
      • Host
      • HostMap
      • LineString
      • Murmur3Token
      • Point
      • Polygon
      • PreparedInfo
      • RandomToken
      • SslOptions
      • Token
      • TokenRange
    • Interfaces
    • Events
    • Global Functions and Constants
Docs Tutorials University Contact Us About Us
© 2026 ScyllaDB | Terms of Service | Privacy Policy | ScyllaDB, and ScyllaDB Cloud, are registered trademarks of ScyllaDB, Inc.
Last updated on 14 May 2026.
Powered by Sphinx 9.1.0 & ScyllaDB Theme 1.9.2