ramdb/docs/list/listAdd.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

2.5 KiB

title, icon, excerpt
title icon excerpt
ArmaRAMDb - List Add mdi:file-text-outline Add element to list stored at key from RAMDb.

ramdb_db_fnc_listAdd

Description

Adds an element to a list stored in the database under the specified key. This function appends values to an existing list or creates a new list if it doesn't exist. It's particularly useful for logging, event tracking, or maintaining collections of data that grow over time.

Syntax

[_key, _data] call ramdb_db_fnc_listAdd

Parameters

Parameter Type Description Default
_key String Name of the list to add the element to ""
_data Array, String, Number, or Boolean The value to insert into the list []

Return Value

None. The operation runs synchronously to add the element to the list.

Examples

Add an event log entry:

["events", ["Server state saved to DB " + systemTimeUTC]] call ramdb_db_fnc_listAdd;

Add a player message:

["messages", [name player + ": " + _messageText]] call ramdb_db_fnc_listAdd;

Add data from a client:

["playerActions", [getPlayerUID player, name player, "logged in"]] remoteExecCall ["ramdb_db_fnc_listAdd", 2, false];

Notes

  • Elements are added to the end of the list in the order they are inserted
  • If the list doesn't exist, it will be created automatically
  • Both the key and data parameters are required and validated
  • Lists can store various data types (arrays, strings, numbers, or booleans)
  • Useful for maintaining a history of events, logs, or sequential data
  • The operation is executed immediately and synchronously
  • New elements are always added to the end of the list
  • All operations are logged for debugging purposes
  • ramdb_db_fnc_listGet: Retrieves a specific element from a list
  • ramdb_db_fnc_listLoad: Retrieves a range of elements from a list
  • ramdb_db_fnc_listSet: Replaces a specific element in a list
  • ramdb_db_fnc_listRemove: Removes a specific element from a list
  • ramdb_db_fnc_listDelete: Deletes an entire list
  • ramdb_db_fnc_scheduler: Processes the callback from the database extension

List Add | List Delete | List Get | List Load | List Remove | List Set