ramdb/docs/hash/hashSetIdBulk.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

74 lines
3.1 KiB
Markdown

---
title: ArmaRAMDb - Hash Set ID Bulk
icon: mdi:file-text-outline
excerpt: Set the specified fields to their respective values in the hash stored at key from RAMDb.
---
# ramdb_db_fnc_hashSetIdBulk
## Description
Sets multiple field-value pairs in a specific hash table identified by its key in a single operation. This function allows efficiently storing multiple related fields at once for a specific identifier, reducing the number of separate database calls required. It's ideal for saving a collection of player-specific or entity-specific data.
## Syntax
```sqf
[_data] call ramdb_db_fnc_hashSetIdBulk
```
## Parameters
| Parameter | Type | Description | Default |
|-----------|-------|--------------------------------------------------------------------|---------|
| `_data` | Array | Array with key followed by alternating field names and values | [] |
## Return Value
None. The operation runs synchronously to store all the data.
## Examples
### Store player loadout and position:
```sqf
[[getPlayerUID player, "loadout", [getUnitLoadout player], "position", [getPosASLVisual player]]] call ramdb_db_fnc_hashSetIdBulk;
```
### Store multiple vehicle properties:
```sqf
[["vehicle_123", "fuel", [0.75], "damage", [0.2], "crew", [["player1", "player2"]]]] call ramdb_db_fnc_hashSetIdBulk;
```
### Store player data from a client:
```sqf
[[getPlayerUID player, "stats", [score player], "inventory", [getAllGear player]]] remoteExecCall ["ramdb_db_fnc_hashSetIdBulk", 2, false];
```
## Notes
- The data array must be structured with the key first, followed by alternating field names and values: `[key, field1, value1, field2, value2, ...]`
- The key must be a string that identifies the specific hash table
- 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 the hash table doesn't exist, it will be created automatically
- If any of the fields already exist in the hash table, their values will be overwritten
- More efficient than multiple individual `hashSetId` calls when setting several fields
- Player UIDs are commonly used as keys to store player-specific data
- The operation is executed immediately and synchronously
- All operations are logged for debugging purposes
## Related Functions
- `ramdb_db_fnc_hashSetId`: Sets a single field value in a specific hash table
- `ramdb_db_fnc_hashSetBulk`: Sets multiple field-value pairs in the global hash table
- `ramdb_db_fnc_hashGetAllId`: Retrieves all fields from a specific hash table
- `ramdb_db_fnc_hashGetId`: Retrieves a specific field value from a specific hash table
- `ramdb_db_fnc_hashDeleteId`: Removes a specific 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)