updateR - Oppenjaimer/LbelDB.js GitHub Wiki

updateR(inx, row)

Update certain row in local memory. Missing array elements will default to an empty string.

Parameter Type Optional Default Description
inx number none Index of the row to update.
row Array none New row data.

Returns: void

Example:

/*
dbs.lbel:
id
user
age
employed

dat.lbel:
10001
Jaime
28
false
*/

const ldb = require("lbeldb");

ldb.retrieve(); // Labels: ["id", "user", "age", "employed"], Rows: [ ["10001", "Jaime", "28", "false"] ]

ldb.updateR(0, ["Marta", 60, false]); // Rows: [ [10001, "Marta", 60, false] ]