Update
How to edit Record content and attributes.
Append to Record
await db.get('tag').append(content)await db.get('tag').prepend(content)Parameter
About
Type
Required
content
The content to add
Any
Truncate Record
await db.get('tag').truncate(length)Parameter
About
Type
Required
length
New file length
Number
Edit Record Content
This will overwrite your record with the content provided.
await db.get('tag').write(content)await db.write("tag", content)Parameter
About
Type
Required
tag
The Record's tag
String
content
The content to overwrite with
Any (must match file extension)
Safe & Atomic Writing
await db.safeWrite('tag', content)Parameter
About
Type
tag
The record tag
String
Content
The new content
Any
await db.atomicUpdate('tag', updater)Name
About
Type
tag
The record tag
String
updater
A function to call to mutate the data
Function
Modify a Key
Parameter
About
Typr
Required
key
The key to set the value to
String
value
The value to set the key to. If value is omitted, it will return the value of key
Any
Modify a Record's Tag
Parameter
About
Type
Required
old_tag
The current tag of the Record.
String
new_tag
The new tag you want for the Record.
String
Empty Record
Emptying a Record deletes the Record content but preserves the file.
Check if a Record is empty
Last updated