Versioning

Dubnium has 2 options to save Record versions.

Structure

The files are stored in DATABASE/.versions/TAG/DATE and the file contents are identical to the Record.

Limit Versions

When initializing, add limit:number to the versioning object to limit the number of stored versions.

const db = new Dubnium('dir', 'txt', { versioning:{ enabled:true, limit:10 } })

Read A Version

db.get('tag').getVersion('date')
Parameter
About
Type
Required

tag

Record tag

String

date

Date of version

String (ISO date)

Last updated