esi-catalog

A library for finding inmation objects

Changes

version date description

0.1.4

2020-12-08

TFS code synchronisation

0.1.3

2020-11-18

Add support for IN operator

0.1.2

2020-10-25

Fix links in the Available Functions section

0.1.1

2018-10-03

Initial release

Available Functions

Documentation

FIND

:FIND(props, settings, operators)

Tries to find an inmation object according to property values.

  local CAT = require 'esi-catalog'
  CAT:FIND("PropertyName","PropertyValue")
  --if no operator is given, equality is assumed, so the following is equivalent:
  CAT:FIND("PropertyName", "PropertyValue", "=")
  --this is also equivalent: tables are used if multiple properties have to be examined
  CAT:FIND({"PropertyName"}, {"PropertyValue"}, {"="})
  --examine multiple properties:
  CAT:FIND({"PropertyName1", "Propname2"}, {"PropertyValue1", 3}, {"=", "<"})
  --check whether a property exists at all
  CAT:FIND({"PropertyName"}, {"%%"}, {"LIKE"})
  --custom properties work as well
  CAT:FIND({"CustomPropertyName.UseCase"}, {"PropertyValue"}, {"="})
  --example with single 'IN' operator:
  CAT:FIND({"PropertyName1"}, {"PropertyValue1, PropertyValue2"}, "IN")
  --example with 'IN' and '=' operators combined
  CAT:FIND({"PropertyName1", "PropertyName2"}, {{"PropertyValue1", "PropertyValue2"}, "PropertyValue3"}, {"IN", "="})

FINDONE

:FINDONE(props, settings, operators)

Works exactly like :FIND, but tries to find only one object (and returns the corresponding inmation object reference if one is found). If multiple objects are found, nil is returned.

Breaking changes

  • Not Applicable