ramdb/docs/hash/hashSetBulk.md
Jacob Schmidt 8c0e8144e5 docs: Update documentation links and function references
This commit updates the documentation to reflect the current function names and link structure. Specifically, it addresses the following:

*   Corrected internal links within the documentation to point to the correct markdown files (e.g., `hashDelete.md` instead of `hashDelete`).
*   Updated related function references to reflect the current function names and include missing functions.
*   Removed outdated function references.
*   Added `ramdb_db_fnc_scheduler` to related functions where appropriate.
*   Updated the links section to use the correct markdown file names.
2025-03-22 16:53:30 -05:00

73 lines
3.1 KiB
Markdown

---
title: ArmaRAMDb - Hash Set Bulk
icon: mdi:file-text-outline
excerpt: Set multiple fields in the current client's hash table in RAMDb.
---
# 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
```sqf
[_data] call ramdb_db_fnc_hashSetBulk
```
## Parameters
| Parameter | Type | Description | Default |
|-----------|-------|---------------------------------------------------------|---------|
| `_data` | Array | Array 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:
```sqf
[["loadout", [getUnitLoadout player], "position", [getPosASLVisual player]]] call ramdb_db_fnc_hashSetBulk;
```
### Store multiple player settings:
```sqf
[["difficulty", ["regular"], "respawn", [true], "tickets", [500]]] call ramdb_db_fnc_hashSetBulk;
```
### Store player data from a client:
```sqf
[["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
## Related Functions
- `ramdb_db_fnc_hashSet`: Sets a single field value in the current client's hash table
- `ramdb_db_fnc_hashSetIdBulk`: Sets multiple field-value pairs in a specific hash table (when you need to specify the ID)
- `ramdb_db_fnc_hashGetAll`: Retrieves all fields from the current client's hash table
- `ramdb_db_fnc_hashGet`: Retrieves a specific field value from the current client's hash table
- `ramdb_db_fnc_hashDelete`: Removes the current client's hash table
## Links
[Hash Delete](hashDelete.md) |
[Hash Delete ID](hashDeleteId.md) |
[Hash Get](hashGet.md) |
[Hash Get All](hashGetAll.md) |
[Hash Get All ID](hashGetAllId.md) |
[Hash Get ID](hashGetId.md) |
[Hash Remove](hashRemove.md) |
[Hash Remove ID](hashRemoveId.md) |
[Hash Set](hashSet.md) |
[Hash Set Bulk](hashSetBulk.md) |
[Hash Set ID](hashSetId.md) |
[Hash Set ID Bulk](hashSetIdBulk.md)