The KV Store atomic operations endpoints let you modify array values stored under a key without overwriting the entire array. Use these to append to, pop from, or remove individual elements of an array, including arrays nested under a JSON path. Each operation runs in a single database transaction so the resulting array state is always consistent.
All three endpoints share the same parameter set: a required db (database path), an optional table name, an optional JSON path to target a nested array, and an optional history flag for change tracking.
Append a value to an array stored under key. If a JSON path is provided, the value is appended to the nested array at that path instead.
Name In Type Required Description keypath string Yes Key name dbquery string Yes Database file path tablequery string No Custom table name. Default: kv_store pathquery string No JSON path to nested array historyquery boolean No Enable history tracking. Default: true
A JSON object containing the value to append. The body schema is open, so any JSON-serializable value can be passed.
curl -X POST " https://proj-prod-abc123-sqlite-1.eu-west-1.containers.hoody.icu/api/v1/sqlite/kv/tasks/push?db=/hoody/databases/app.db&path=$.pending " \
-H " Content-Type: application/json " \
await client . sqlite . kvStore . push (
{ db : " /hoody/databases/app.db " , path : " $.pending " }
" message " : " Value at path $.pending is not an array "
Error Code Title Description Resolution INVALID_DB_PATHInvalid database path The provided database path is invalid or inaccessible Provide a valid absolute path, or use bare name / ./name shorthand (resolved to /hoody/databases/*.db) INVALID_PARAMETERSInvalid request parameters One or more request parameters are invalid or malformed Check parameter types and values against the API specification INVALID_SQLITE_HEADERNot a valid SQLite database The file exists but is not a valid SQLite database Ensure the file is a valid SQLite database with proper header PATH_IS_DIRECTORYPath is a directory Expected a.db file but got a directory (use table parameter for directory mode) Use a .db file path or add table parameter for directory mode KV store
" error " : " Internal Server Error " ,
" message " : " Database write failed "
Error Code Title Description Resolution DATABASE_ERRORDatabase operation failed An internal database error occurred Check server logs for details. Database may be corrupted or locked. FILE_SYSTEM_ERRORFile system error Failed to read or write filesystem in directory mode Check file permissions and disk space
Remove and return the last element from an array stored under key. If a JSON path is provided, the operation targets the nested array at that path.
Name In Type Required Description keypath string Yes Key name dbquery string Yes Database file path tablequery string No Custom table name. Default: kv_store pathquery string No JSON path to nested array historyquery boolean No Enable history tracking. Default: true
This endpoint takes no request body.
curl -X POST " https://proj-prod-abc123-sqlite-1.eu-west-1.containers.hoody.icu/api/v1/sqlite/kv/tasks/pop?db=/hoody/databases/app.db&path=$.pending " \
-H " Content-Type: application/json "
await client . sqlite . kvStore . pop ( " tasks " , {
db : " /hoody/databases/app.db " ,
" message " : " Value at path $.pending is not an array "
Error Code Title Description Resolution INVALID_DB_PATHInvalid database path The provided database path is invalid or inaccessible Provide a valid absolute path, or use bare name / ./name shorthand (resolved to /hoody/databases/*.db) INVALID_PARAMETERSInvalid request parameters One or more request parameters are invalid or malformed Check parameter types and values against the API specification INVALID_SQLITE_HEADERNot a valid SQLite database The file exists but is not a valid SQLite database Ensure the file is a valid SQLite database with proper header PATH_IS_DIRECTORYPath is a directory Expected a.db file but got a directory (use table parameter for directory mode) Use a .db file path or add table parameter for directory mode KV store
" message " : " Key 'tasks' not found "
Error Code Title Description Resolution KEY_NOT_FOUNDKey not found The requested key does not exist in the KV store Verify the key name and database/table parameters DATABASE_NOT_FOUNDDatabase file does not exist The specified database file was not found Check the file path or use create_db_if_missing=true to create it KEY_EXPIREDKey expired The key existed but has expired due to TTL The key was automatically deleted. Store a new value if needed.
" error " : " Internal Server Error " ,
" message " : " Database read failed "
Error Code Title Description Resolution DATABASE_ERRORDatabase operation failed An internal database error occurred Check server logs for details. Database may be corrupted or locked. FILE_SYSTEM_ERRORFile system error Failed to read or write filesystem in directory mode Check file permissions and disk space
Remove a single element from an array stored under key. Identify the element either by index (zero-based position) as a query parameter, or by a value match in the request body. If a JSON path is provided, the operation targets the nested array at that path.
Name In Type Required Description keypath string Yes Key name dbquery string Yes Database file path tablequery string No Custom table name. Default: kv_store pathquery string No JSON path to nested array indexquery integer No Array index to remove historyquery boolean No Enable history tracking. Default: true
A JSON object carrying the value to match and remove when index is not supplied. The body schema is open, so any JSON-serializable value is accepted and the first element equal to it is removed.
curl -X POST " https://proj-prod-abc123-sqlite-1.eu-west-1.containers.hoody.icu/api/v1/sqlite/kv/tasks/remove?db=/hoody/databases/app.db&path=$.pending&index=0 " \
-H " Content-Type: application/json " \
await client . sqlite . kvStore . removeElement (
{ db : " /hoody/databases/app.db " , path : " $.pending " , index : 0 }
" message " : " Value at path $.pending is not an array "
Error Code Title Description Resolution INVALID_DB_PATHInvalid database path The provided database path is invalid or inaccessible Provide a valid absolute path, or use bare name / ./name shorthand (resolved to /hoody/databases/*.db) INVALID_PARAMETERSInvalid request parameters One or more request parameters are invalid or malformed Check parameter types and values against the API specification INVALID_SQLITE_HEADERNot a valid SQLite database The file exists but is not a valid SQLite database Ensure the file is a valid SQLite database with proper header PATH_IS_DIRECTORYPath is a directory Expected a.db file but got a directory (use table parameter for directory mode) Use a .db file path or add table parameter for directory mode KV store
" message " : " No matching element found in array "
Error Code Title Description Resolution KEY_NOT_FOUNDKey not found The requested key does not exist in the KV store Verify the key name and database/table parameters DATABASE_NOT_FOUNDDatabase file does not exist The specified database file was not found Check the file path or use create_db_if_missing=true to create it KEY_EXPIREDKey expired The key existed but has expired due to TTL The key was automatically deleted. Store a new value if needed.
" error " : " Internal Server Error " ,
" message " : " Database write failed "
Error Code Title Description Resolution DATABASE_ERRORDatabase operation failed An internal database error occurred Check server logs for details. Database may be corrupted or locked. FILE_SYSTEM_ERRORFile system error Failed to read or write filesystem in directory mode Check file permissions and disk space
Tip
When modifying deeply nested arrays, supply a JSONPath expression in the path query parameter (for example $.items[2].tags). The push, pop, and remove operations all honor the same path syntax, so a single helper in your code can switch between them based on user intent.