JSPM

  • Created
  • Published
  • Downloads 1
  • Score
    100M100P100Q67410F
  • License MIT

This package serves as an adapter for snapshots using MongoDB.

Package Exports

  • resolve-snapshot-mongo

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (resolve-snapshot-mongo) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

resolve-snapshot-mongo

npm version

This package is an adapter for storing snapshots using MongoDB.

Available Parameters

  • url - the connection URI string.
  • tableName - the table name.
  • bucketSize - the bucket size.

Usage

import createSnapshotAdapter from 'resolve-snapshot-mongo'

const snapshotAdapter = createSnapshotAdapter({
  url: 'mongodb://[username:password@]host1[:port1][,...hostN[:portN]]][/[database][?options]]',
  tableName: 'TableName',
  bucketSize: 100
})

await snapshotAdapter.loadSnapshot(key)
await snapshotAdapter.saveSnapshot(key, value)
await snapshotAdapter.dispose()

Analytics