Versioning

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)

Manually Save Snapshot

circle-info

This allows you to create a version at any point in time, even if automatic versioning is disabled or the limit has been reached.

db.get('tag').saveSnapshot()

Example

Generator

Last updated