Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Use the following reference tables for descriptions and examples of the functions that you can use with the Cache Pipelines feature. The Pipeline Property Cache Pipelines comprises a field set of Alias and Pipeline values. Use this function in the Alias when specifying the Alias value. Safe retrieval functions return null instead of an error if values are missing or incorrectly entered.

Functions

Cfm tabs page
primaryTabtrue
colorPalettesDefault
an.spaceKeyDRWIP
tabsPageTitlecache.retrieve
color#0052CC
fixedfalse
id7wmr26ceq77
hasBordertrue
backgroundColorPaletteDefault
headerStyleBasic
directionhorizontal

Description:This function retrieves the first matching object from the specified cache alias based on the provided filter conditions. If the cache isn't defined in the pipeline cache settings, the function generates an error. If the filter criteria don’t match with any data, it returns null. The entire stored document that aligns with the filter criteria is returned.

Syntax: cache.retrieve("alias", {"filter": "object"})

Example: Data in cache "alias":

Code Block
[
  {"id": 1, "name": "Test", "num": 10},
  {"id": 2, "name": "Test 2", "num": 20},
  {"id": 3, "name": "Test 3", "num": 20}
]

Expressioncache.retrieve("alias", {"num": 20})

Result: {"id": 2, "name": "Test 2", "num": 20}

Expression: cache.retrieve("alias", {"num": 15})

Resultnull

Expression: cache.retrieve("test", {"num": 20})

Result: Error: Alias 'test' missing from the cache

Cfm tabs page
tabsPageTitlecache.retrieveFirst
colorPalettesDefault
an.spaceKeyDRWIP
primaryTabfalse
color#0052CC
idevxmfwnniqe
backgroundColorPaletteDefault

Description:This function retrieves the first matching object from the specified cache alias based on the provided filter conditions. If the cache isn't defined in the pipeline cache settings, the function generates an error. If the filter criteria don’t match with any data, it returns null. The entire stored document that aligns with the filter criteria is returned.

Syntax: cache.retrieveFirst("alias", {"filter": "object"})

Examples: Data in cache "alias":

Code Block
[
  {"id": 1, "name": "Test", "num": 10},
  {"id": 2, "name": "Test 2", "num": 20},
  {"id": 3, "name": "Test 3", "num": 20}
]

Expressioncache.retrieveFirst("alias", {"num": 20})

Result: {"id": 2, "name": "Test 2", "num": 20}

Expression: cache.retrieveFirst("alias", {"num": 15})

Resultnull

Expression: cache.retrieveFirst("test", {"num": 20})

Result: Error: Alias 'test' missing from the cache

Cfm tabs page
tabsPageTitlecache.retrieveAll
colorPalettesDefault
an.spaceKeyDRWIP
primaryTabfalse
color#0052CC
idpd648h78ell
backgroundColorPaletteDefault

Description: This function returns all matching objects from the specified cache alias using the filter conditions as provided. If the cache hasn’t been defined in the pipeline cache settings, the function will throw an error. If the filter criteria doesn’t match any data, it will return null. The Entire document that has been stored and matches the filter criteria will be returned.

Syntax: cache.retrieveAll("alias", {"filter": "object"})

Examples: Data in cache "alias":

Code Block
[
  {"id": 1, "name": "Test", "num": 10},
  {"id": 2, "name": "Test 2", "num": 20},
  {"id": 3, "name": "Test 3", "num": 20}
]

Expressioncache.retrieveAll("alias", {"num": 20})

Result:

Code Block
[
  {"id": 2, "name": "Test 2", "num": 20},
  {"id": 3, "name": "Test 3", "num": 20},
}  

Expression: cache.retrieveAll("alias", {"num": 15})

Resultnull

Expression: cache.retrieveAll("test", {"num": 20})

Result: Error: Alias 'test' missing from the cache

Cfm tabs page
tabsPageTitlecache.retrieveLast
colorPalettesDefault
an.spaceKeyDRWIP
primaryTabfalse
color#0052CC
id7ihej16ed3a
backgroundColorPaletteDefault

Description: This function returns the last matching object from the specified cache alias using the filter conditions as provided. If the cache hasn’t been defined in the pipeline cache settings, the function will throw an error. If the filter criteria doesn’t match any data, it will return null. The Entire document that has been stored and matches the filter criteria will be returned.

Syntax: cache.retrieveLast("alias", {"filter": "object"})

Example: Data in cache "alias":

Code Block
[
  {"id": 1, "name": "Test", "num": 10},
  {"id": 2, "name": "Test 2", "num": 20},
  {"id": 3, "name": "Test 3", "num": 20}
]

Expressioncache.retrieveLast("alias", {"num": 20})

Result: {"id": 3, "name": "Test 3", "num": 20}

Expression: cache.retrieveLast("alias", {"num": 15})

Resultnull

Expression: cache.retrieveLast("test", {"num": 20})

Result: Error: Alias 'test' missing from the cache

Cfm tabs page
tabsPageTitlecache.safeRetrieve
colorPalettesDefault
an.spaceKeyDRWIP
primaryTabfalse
color#0052CC
id1hzan5fi7lb
backgroundColorPaletteDefault

Description: This function returns the first matching object from the specified cache alias using the filter conditions as provided. If the cache hasn’t been defined in the pipeline cache settings, the function will return null. If the filter criteria doesn't match any data, it will return null. The Entire document that has been stored and matches the filter criteria will be returned.

Syntax: cache.retrieve("alias", {"filter": "object"})

Examples: Data in cache "alias":

Code Block
[
  {"id": 1, "name": "Test", "num": 10},
  {"id": 2, "name": "Test 2", "num": 20},
  {"id": 3, "name": "Test 3", "num": 20}
]

Expressioncache.retrieve("alias", {"num": 20})

Result: {"id": 2, "name": "Test 2", "num": 20}

Expression: cache.retrieve("alias", {"num": 15})

Resultnull

Expression: cache.retrieve("test", {"num": 20})

Result: null

Cfm tabs page
tabsPageTitlecache.safeRetrieveFirst
colorPalettesDefault
an.spaceKeyDRWIP
primaryTabfalse
color#0052CC
idma9ccovx6d
backgroundColorPaletteDefault

Description: This function returns the first matching object from the specified cache alias using the filter conditions as provided. If the cache hasn’t been defined in the pipeline cache settings, the function will return null. If the filter criteria doesn't match any data, it will return null. The Entire document that has been stored and matches the filter criteria will be returned.

Syntax: cache.safeRetrieveFirst("alias", {"filter": "object"})

Examples: Data in cache "alias":

Code Block
[
  {"id": 1, "name": "Test", "num": 10},
  {"id": 2, "name": "Test 2", "num": 20},
  {"id": 3, "name": "Test 3", "num": 20}
]

Expressioncache.safeRetrieveFirst("alias", {"num": 20})

Result:

Code Block
{"id": 2, "name": "Test 2", "num": 20}

Expression: cache.safeRetrieveFirst("alias", {"num": 15})

Resultnull

Expression: cache.safeRetrieveFirst("test", {"num": 20})

Result: null

Cfm tabs page
tabsPageTitlecache.safeRetrieveLast
colorPalettesDefault
an.spaceKeyDRWIP
primaryTabfalse
color#0052CC
idgtcuq8xm54m
backgroundColorPaletteDefault

Description: This function returns the last matching object from the specified cache alias using the filter conditions as provided. If the cache hasn’t been defined in the pipeline cache settings, the function will return null. If the filter criteria doesn't match any data, it will return null. The Entire document that has been stored and matches the filter criteria will be returned.

Syntax: cache.safeRetrieveLast("alias", {"filter": "object"})

Examples: Data in cache "alias":

Code Block
[
  {"id": 1, "name": "Test", "num": 10},
  {"id": 2, "name": "Test 2", "num": 20},
  {"id": 3, "name": "Test 3", "num": 20}
]

Expressioncache.safeRetrieveLast("alias", {"num": 20})

Result: {"id": 3, "name": "Test 3", "num": 20}

Expression: cache.safeRetrieveLast("alias", {"num": 15})

Resultnull

Expression: cache.safeRetrieveLast("test", {"num": 20})

Result: null

Cfm tabs page
tabsPageTitlecache.safeRetrieveAll
colorPalettesDefault
an.spaceKeySD
color#0052CC
idsxgptesgseo
backgroundColorPaletteDefault

Description: This function returns all matching objects from the specified cache alias using the filter conditions as provided. If the cache hasn’t been defined in the pipeline cache settings, the function will return null. If the filter criteria doesn't match any data, it will return null. The Entire document that has been stored and matches the filter criteria will be returned.

Syntax: cache.safeRetrieveAll("alias", {"filter": "object"})

Examples: Data in cache "alias":

Code Block
[
  {"id": 1, "name": "Test", "num": 10},
  {"id": 2, "name": "Test 2", "num": 20},
  {"id": 3, "name": "Test 3", "num": 20}
]

Expressioncache.safeRetrieveAll("alias", {"num": 20})

Result:

Code Block
[
  {"id": 2, "name": "Test 2", "num": 20},
  {"id": 3, "name": "Test 3", "num": 20},
}  

Expression: cache.safeRetrieveAll("alias", {"num": 15})

Resultnull

Expression: cache.retrieveLast("test", {"num": 20})

Result: null