updateRi - Oppenjaimer/LbelDB.js GitHub Wiki
updateRi(inxR, inxI, item)
Update a single item of certain row in local memory.
Parameter | Type | Optional | Default | Description |
---|---|---|---|---|
inxR | number |
❌ | none | Index of the row to access. |
inxI | number |
❌ | none | Index of the item to update. |
item | * |
❌ | none | New item 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.updateRi(0, 2, true); // Rows: [ ["10001", "Jaime", "28", true] ]