Extends
- events.EventEmitter
Methods
clear() → {Array.<Host>}
WARNING:
Editing host map does not affect the connection to the database. You only edit the local copy of the connected hosts.
Removes all items from the map.
- Deprecated:
- Editing underlying connections will not be supported in this driver
- Source:
Returns:
The previous items
- Type
- Array.<Host>
forEach(callback)
Executes a provided function once per map element.
Parameters:
| Name | Type | Description |
|---|---|---|
callback |
get(key) → {Host}
Gets a host by key or undefined if not found.
Parameters:
| Name | Type | Description |
|---|---|---|
key |
String |
Returns:
- Type
- Host
keys() → {Array.<String>}
Returns an array of host addresses.
Returns:
- Type
- Array.<String>
remove(key)
WARNING:
Editing host map does not affect the connection to the database. You only edit the local copy of the connected hosts.
Removes an item from the map.
Parameters:
| Name | Type | Description |
|---|---|---|
key |
String | The key of the host |
- Deprecated:
- Editing underlying connections will not be supported in this driver
- Source:
Fires:
- HostMap#event:remove
removeMultiple(keys)
WARNING:
Editing host map does not affect the connection to the database. You only edit the local copy of the connected hosts.
Removes multiple hosts from the map.
Parameters:
| Name | Type | Description |
|---|---|---|
keys |
Array.<String> |
- Deprecated:
- Editing underlying connections will not be supported in this driver
- Source:
Fires:
- HostMap#event:remove
set(key, value)
WARNING:
Editing host map does not affect the connection to the database. You only edit the local copy of the connected hosts.
Adds a new item to the map.
Parameters:
| Name | Type | Description |
|---|---|---|
key |
String | The key of the host |
value |
Host | The host to be added |
- Deprecated:
- Editing underlying connections will not be supported in this driver
- Source:
Fires:
- HostMap#event:remove
- HostMap#event:add
values() → {Array.<Host>}
Returns a shallow copy of the values of the map.
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> |