Dubnium
v3
v3
  • Overview
  • API
    • Initialize
    • Manage
    • Get
    • Edit
    • Search
    • Miscellaneous
    • Middleware
    • Versioning
  • TEMPLATES
    • JSON
    • String
  • EXTENSIONS
    • Setup
    • Create
    • Find
  • OTHER
  • CLI
  • Events
  • Update Log
  • EXTERNAL LINKS
    • Need more help?
    • Report an Issue
Powered by GitBook
On this page
  • Create Record
  • Delete Record
  • Close
  • Wipe
  • Delete Old Records
  • Delete Large Records

Was this helpful?

  1. API

Manage

How to create & delete Records.

Create Record

db.create('tag', content, options)
Parameter
About
Type
Required

tag

The new Record's tag

String

content

The Record's content

Any

options

writeFile options

String || Object

const { Record } = require("dubnium")
Record( tag:"tag", dir:"./data", ext:"json", content )
Parameter
About
Type
Required

dir

Dir to create in

String

tag

Record's tag

String

content

Record content

Any

ext

File extension

String

If ext is not specified, it will default to json

db.create('tag', path, options)
Parameter
About
Type
Required

tag

The new Record's tag

String

path

Path to get content from

String

options

writeFile options

String || object

db.get('tag').clone('target')
Parameter
About
Type
Required

target

Target directory to clone the record in.

String

Delete Record

db.get('tag').delete()
db.delete('tag')

Close

Delete all records & the directory

db.close()

Wipe

Delete all records & preserve the directory

db.wipe()

Delete Old Records

db.deleteOld({ ms:5, seconds:5, minutes:5, hours:5, days:0})

Requires at least one of the options below (multiple options will stack)

Name
About
Type

ms

Milliseconds

Number

seconds

Seconds

Number

minutes

Minutes

Number

hour

Hours

Number

days

Days

Number

Delete Large Records

db.deleteLarge({ bytes:0, kilobytes:0, megabytes:0, gigabytes:0 })

Requires at least one of the options below (multiple options will stack)

Name
About
Type

options.bytes

Bytes

Number

options.kilobytes

Kilobytes

Number

options.megabytes

Megabytes

Number

options.gigabytes

Gigabytes

Number

PreviousInitializeNextGet

Last updated 1 year ago

Was this helpful?