Skip to content

Latest commit

 

History

History
39 lines (24 loc) · 961 Bytes

File metadata and controls

39 lines (24 loc) · 961 Bytes

ConstructorOptions

Options for class constructor

Properties

  • client MongoClient configured mongo client to use. Can be null if url is set
  • databaseName string? name of the mongodb database
  • collectionName string name of the mongodb collection used to store the resources

Examples

import { OneToFewResourceStorage } from '@discue/mongodb-resource-client'

const collectionName = 'api_clients'
const url = 'mongodb://127.0.0.1:27017'

const storage = new OneToFewResourceStorage({
  url,
  collectionName
})

storage.enableHistory()

ResourceStorageHistory

Simple resource class that will listen to storage events of the given storage object

close

Closes the database client

Returns void