In this article

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

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":

[
  {"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

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":

[
  {"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

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":

[
  {"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:

[
  {"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

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":

[
  {"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

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":

[
  {"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

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":

[
  {"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:

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

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

Resultnull

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

Result: null

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":

[
  {"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

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":

[
  {"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:

[
  {"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