Skip to end of banner
Go to start of banner

Pipeline Cache Properties (Private Beta)

Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 19 Next »

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 differ from the others in that safe retrieval returns null instead of an error values are missing or incorrectly entered.

Functions

cache.retrieve

Description

This function returns the first matching object from the specified cache alias using the filter conditions as provided. The entire document that has been stored and matches the filter criteria is returned.

If the cache hasn’t been defined in the Cache Pipelines field set, the function returns an error.

If the filter criteria doesn’t match any data, it returns null.

Syntax

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

Examples

Data in cache "data":

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

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

Result:

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

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

Result

null

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

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

Expression: cache.retrieve("data", {"id": 1, "num": 10})
Result:

{"id": 1, "name": "Test", "num": 10}

cache.retrieveFirst

Description

This function specifically returns the first matching object from the specified cache alias using the filter conditions as provided. The entire document that has been stored and matches the filter criteria is returned.

If the cache hasn’t been defined in the Cache Pipelines field set, the function returns an error.

If the filter criteria doesn’t match any data, it returns null.

Syntax

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

Examples

Data in cache "data":

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

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

Result:

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

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

Result

null

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

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

cache.retrieveLast

Description

This function specifically returns the last matching object from the specified cache alias using the filter conditions as provided. The entire document that has been stored and matches the filter criteria is returned.

If the cache hasn’t been defined in the Cache Pipelines field set, the function returns an error.

If the filter criteria doesn’t match any data, it returns null.

Syntax

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

Examples

Data in cache "data":

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

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

Result:

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

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

Result

null

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

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

cache.retrieveAll

Description

This function returns all of the matching objects from the specified cache alias using the filter conditions as provided. The entire document that has been stored and matches the filter criteria is returned.

If the cache hasn’t been defined in the Cache Pipelines field set, the function returns an error.

If the filter criteria doesn’t match any data, it returns null.

Syntax

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

Examples

Data in cache "data":

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

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

Result:

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

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

Result

null

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

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

cache.safeRetrieve

Description

This function returns the first matching object from the specified cache alias using the filter conditions as provided. The entire document that has been stored and matches the filter criteria is returned.

If the cache hasn’t been defined in the Cache Pipelines field set, the function returns null.

If the filter criteria doesn’t match any data, it returns null.

Syntax

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

Examples

Data in cache "data":

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

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

Result:

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

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

Result

null

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

Result:

null

cache.safeRetrieveFirst

Description

This function returns the first matching object from the specified cache alias using the filter conditions as provided. The entire document that has been stored and matches the filter criteria is returned.

If the cache hasn’t been defined in the Cache Pipelines field set, the function returns null.

If the filter criteria doesn’t match any data, it returns null.

Syntax

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

Examples

Data in cache "data":

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

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

Result:

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

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

Result

null

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

Result:

null

cache.safeRetrieveLast

Description

This function returns the last matching object from the specified cache alias using the filter conditions as provided. The entire document that has been stored and matches the filter criteria is returned.

If the cache hasn’t been defined in the Cache Pipelines field set, the function returns null.

If the filter criteria doesn’t match any data, it returns null.

Syntax

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

Examples

Data in cache "data":

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

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

Result:

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

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

Result

null

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

Result:

null

cache.safeRetrieveAll

Description

This function returns all of the matching objects from the specified cache alias using the filter conditions as provided. The entire document that has been stored and matches the filter criteria is returned.

If the cache hasn’t been defined in the Cache Pipelines field set, the function returns null.

If the filter criteria doesn’t match any data, it returns null.

Syntax

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

Examples

Data in cache "data":

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

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

Result:

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

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

Result

null

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

Result:

null
  • No labels