ArmaRAMDb - Hash Set Bulk

ramdb_db_fnc_hashSetBulk

Description

Sets multiple field-value pairs in the hash table associated with the current client/player in a single operation. This function automatically determines the appropriate hash ID based on the caller's identity, making it more convenient than hashSetIdBulk which requires manually specifying an ID. It allows efficiently storing multiple related fields at once, reducing the number of separate database calls required.

Syntax

[_data] call ramdb_db_fnc_hashSetBulk

Parameters

ParameterTypeDescriptionDefault
_dataArrayArray of alternating field names and values to store

Return Value

None. The operation runs synchronously to store all the data.

Examples

Store player loadout and position:

[["loadout", [getUnitLoadout player], "position", [getPosASLVisual player]]] call ramdb_db_fnc_hashSetBulk;

Store multiple player settings:

[["difficulty", ["regular"], "respawn", [true], "tickets", [500]]] call ramdb_db_fnc_hashSetBulk;

Store player data from a client:

[["name", [name player], "uid", [getPlayerUID player], "score", [score player]]] remoteExecCall ["ramdb_db_fnc_hashSetBulk", 2, false];

Notes

  • The data array must be structured as alternating field names and values: [field1, value1, field2, value2, ...]
  • Each field name must be a string
  • Values can be arrays, strings, numbers, or booleans
  • All field-value pairs are stored in a single database operation
  • If any of the fields already exist, their values will be overwritten
  • This function automatically determines which hash table to use based on the caller's identity
  • Use hashSetIdBulk when you need to specify a particular hash table by ID
  • More efficient than multiple individual hashSet calls when setting several fields
  • The operation is executed immediately and synchronously
  • All operations are logged for debugging purposes

Hash Delete | Hash Delete ID | Hash Get | Hash Get All | Hash Get All ID | Hash Get ID | Hash Remove | Hash Remove ID | Hash Set | Hash Set Bulk | Hash Set ID | Hash Set ID Bulk