<?xml version='1.0' encoding='UTF-8' standalone='no'?>
<section xmlns="http://docbook.org/ns/docbook" version="5.0" xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="_md_docs_2hash_2hash_set_id_bulk" xml:lang="en-US">
<title>hashSetIdBulk</title>
<indexterm><primary>hashSetIdBulk</primary></indexterm>
<section xml:id="_md_docs_2hash_2hash_set_id_bulk_1autotoc_md329">
<title>autotoc_md329</title>
<para>title: ArmaRAMDb - Hash Set ID Bulk icon: mdi:file-text-outline </para>
</section>
<section xml:id="_md_docs_2hash_2hash_set_id_bulk_1autotoc_md330">
<title>excerpt: Set the specified fields to their respective values in the hash stored at key from RAMDb.</title></section>
<section xml:id="_md_docs_2hash_2hash_set_id_bulk_1autotoc_md331">
<title>ramdb_db_fnc_hashSetIdBulk</title><section xml:id="_md_docs_2hash_2hash_set_id_bulk_1autotoc_md332">
<title>Description</title>
<para>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&apos;s ideal for saving a collection of player-specific or entity-specific data.</para>
</section>
<section xml:id="_md_docs_2hash_2hash_set_id_bulk_1autotoc_md333">
<title>Syntax</title>
<para><literallayout><computeroutput>[_data]&#32;call&#32;ramdb_db_fnc_hashSetIdBulk
</computeroutput></literallayout></para>
</section>
<section xml:id="_md_docs_2hash_2hash_set_id_bulk_1autotoc_md334">
<title>Parameters</title>
<para><informaltable frame="all">
    <tgroup cols="4" align="left" colsep="1" rowsep="1">
      <colspec colname='c1'/>
      <colspec colname='c2'/>
      <colspec colname='c3'/>
      <colspec colname='c4'/>
<thead>
      <row  class='markdownTableHead'>
<entry>
<para>Parameter   </para>
</entry><entry>
<para>Type   </para>
</entry><entry>
<para>Description   </para>
</entry><entry>
<para>Default    </para>
</entry></row>
</thead><tbody>
      <row  class='markdownTableRowOdd'>
<entry>
<para><computeroutput>_data</computeroutput>   </para>
</entry><entry>
<para>Array   </para>
</entry><entry>
<para>Array with key followed by alternating field names and values   </para>
</entry><entry>
<para>[]   </para>
</entry></row>
    </tbody>
    </tgroup>
</informaltable>
</para>
</section>
<section xml:id="_md_docs_2hash_2hash_set_id_bulk_1autotoc_md335">
<title>Return Value</title>
<para>None. The operation runs synchronously to store all the data.</para>
</section>
<section xml:id="_md_docs_2hash_2hash_set_id_bulk_1autotoc_md336">
<title>Examples</title><section xml:id="_md_docs_2hash_2hash_set_id_bulk_1autotoc_md337">
<title>Store player loadout and position:</title>
<para><literallayout><computeroutput>[[getPlayerUID&#32;player,&#32;&quot;loadout&quot;,&#32;[getUnitLoadout&#32;player],&#32;&quot;position&quot;,&#32;[getPosASLVisual&#32;player]]]&#32;call&#32;ramdb_db_fnc_hashSetIdBulk;
</computeroutput></literallayout></para>
</section>
<section xml:id="_md_docs_2hash_2hash_set_id_bulk_1autotoc_md338">
<title>Store multiple vehicle properties:</title>
<para><literallayout><computeroutput>[[&quot;vehicle_123&quot;,&#32;&quot;fuel&quot;,&#32;[0.75],&#32;&quot;damage&quot;,&#32;[0.2],&#32;&quot;crew&quot;,&#32;[[&quot;player1&quot;,&#32;&quot;player2&quot;]]]]&#32;call&#32;ramdb_db_fnc_hashSetIdBulk;
</computeroutput></literallayout></para>
</section>
<section xml:id="_md_docs_2hash_2hash_set_id_bulk_1autotoc_md339">
<title>Store player data from a client:</title>
<para><literallayout><computeroutput>[[getPlayerUID&#32;player,&#32;&quot;stats&quot;,&#32;[score&#32;player],&#32;&quot;inventory&quot;,&#32;[getAllGear&#32;player]]]&#32;remoteExecCall&#32;[&quot;ramdb_db_fnc_hashSetIdBulk&quot;,&#32;2,&#32;false];
</computeroutput></literallayout></para>
</section>
</section>
<section xml:id="_md_docs_2hash_2hash_set_id_bulk_1autotoc_md340">
<title>Notes</title>
<para><itemizedlist>
<listitem>
<para>The data array must be structured with the key first, followed by alternating field names and values: <computeroutput>[key, field1, value1, field2, value2, ...]</computeroutput></para>
</listitem><listitem>
<para>The key must be a string that identifies the specific hash table</para>
</listitem><listitem>
<para>Each field name must be a string</para>
</listitem><listitem>
<para>Values can be arrays, strings, numbers, or booleans</para>
</listitem><listitem>
<para>All field-value pairs are stored in a single database operation</para>
</listitem><listitem>
<para>If the hash table doesn&apos;t exist, it will be created automatically</para>
</listitem><listitem>
<para>If any of the fields already exist in the hash table, their values will be overwritten</para>
</listitem><listitem>
<para>More efficient than multiple individual <computeroutput>hashSetId</computeroutput> calls when setting several fields</para>
</listitem><listitem>
<para>Player UIDs are commonly used as keys to store player-specific data</para>
</listitem><listitem>
<para>The operation is executed immediately and synchronously</para>
</listitem><listitem>
<para>All operations are logged for debugging purposes</para>
</listitem></itemizedlist>
</para>
</section>
<section xml:id="_md_docs_2hash_2hash_set_id_bulk_1autotoc_md341">
<title>Related Functions</title>
<para><itemizedlist>
<listitem>
<para><computeroutput>ramdb_db_fnc_hashSetId</computeroutput>: Sets a single field value in a specific hash table</para>
</listitem><listitem>
<para><computeroutput>ramdb_db_fnc_hashSetBulk</computeroutput>: Sets multiple field-value pairs in the global hash table</para>
</listitem><listitem>
<para><computeroutput>ramdb_db_fnc_hashGetAllId</computeroutput>: Retrieves all fields from a specific hash table</para>
</listitem><listitem>
<para><computeroutput>ramdb_db_fnc_hashGetId</computeroutput>: Retrieves a specific field value from a specific hash table</para>
</listitem><listitem>
<para><computeroutput>ramdb_db_fnc_hashDeleteId</computeroutput>: Removes a specific hash table</para>
</listitem></itemizedlist>
</para>
</section>
<section xml:id="_md_docs_2hash_2hash_set_id_bulk_1autotoc_md342">
<title>Links</title>
<para><link linkend="_md_docs_2hash_2hash_delete">Hash Delete</link> | <link linkend="_md_docs_2hash_2hash_delete_id">Hash Delete ID</link> | <link linkend="_md_docs_2hash_2hash_get">Hash Get</link> | <link linkend="_md_docs_2hash_2hash_get_all">Hash Get All</link> | <link linkend="_md_docs_2hash_2hash_get_all_id">Hash Get All ID</link> | <link linkend="_md_docs_2hash_2hash_get_id">Hash Get ID</link> | <link linkend="_md_docs_2hash_2hash_remove">Hash Remove</link> | <link linkend="_md_docs_2hash_2hash_remove_id">Hash Remove ID</link> | <link linkend="_md_docs_2hash_2hash_set">Hash Set</link> | <link linkend="_md_docs_2hash_2hash_set_bulk">Hash Set Bulk</link> | <link linkend="_md_docs_2hash_2hash_set_id">Hash Set ID</link> | <link linkend="_md_docs_2hash_2hash_set_id_bulk">Hash Set ID Bulk</link> </para>
</section>
</section>
</section>
