DataCache

core. DataCache

Time-limited data cache

Constructor

new DataCache(options)

Source:
Parameters:
Name Type Description
options Object
Properties
Name Type Description
enable Boolean Whether the cache is enabled
lifespan Number Cache entry lifespan in milliseconds

Methods

(async) get(query, options, mongoOptions) → {*}

Description:
  • Retrieve cached data, or run fresh query if no cache exists or cache is invalid
Source:
Parameters:
Name Type Description
query Object
options Object
mongoOptions Object
Returns:
The cached data
Type
*

prune()

Description:
  • Removes invalid cache data
Source: