dragonfly/docs/hash/hashSetIdBulk.md
Jacob Schmidt c8d81ba3bb
All checks were successful
Build / Build (push) Successful in 39s
docs: Update README.md with detailed documentation
This commit significantly enhances the `README.md` file, providing comprehensive documentation for the ArmaDragonflyClient.

Key changes:

*   **Detailed Function Categories:** Categorized functions for better organization (Core, Basic Data Operations, Hash Operations, List Operations).
*   **Usage Examples:** Added clear and concise usage examples for basic operations, hash operations (context and ID-specific), and list operations.
*   **Function Documentation Structure:** Outlined the structure for individual function documentation.
*   **License Information:** Updated the license information.
2025-03-30 17:15:35 -05:00

3.0 KiB

title, icon, excerpt
title icon excerpt
ArmaDragonflyClient - Hash Set ID Bulk mdi:file-text-outline Set the specified fields to their respective values in the hash stored at key from DragonflyClient.

dragonfly_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

[_data] call dragonfly_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:

[[getPlayerUID player, "loadout", [getUnitLoadout player], "position", [getPosASLVisual player]]] call dragonfly_db_fnc_hashSetIdBulk;

Store multiple vehicle properties:

[["vehicle_123", "fuel", [0.75], "damage", [0.2], "crew", [["player1", "player2"]]]] call dragonfly_db_fnc_hashSetIdBulk;

Store player data from a client:

[[getPlayerUID player, "stats", [score player], "inventory", [getAllGear player]]] remoteExecCall ["dragonfly_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
  • dragonfly_db_fnc_hashSetId: Sets a single field value in a specific hash table
  • dragonfly_db_fnc_hashSetBulk: Sets multiple field-value pairs in the global hash table
  • dragonfly_db_fnc_hashGetAllId: Retrieves all fields from a specific hash table
  • dragonfly_db_fnc_hashGetId: Retrieves a specific field value from a specific hash table

Hash Get | Hash Get All | Hash Get All ID | Hash Get ID | Hash Set | Hash Set Bulk | Hash Set ID | Hash Set ID Bulk