The openidm.query function enables you
to query OpenIDM resource objects for reconciliation processes
and workflows. Query syntax is
openidm.query(id, params), where
id specifies the object on which the query should
be performed and params provides the parameters
that are passed to the query. For example:
var params = {
'query' : {
'Equals': {
'field' : 'uid',
'values' : [
id
]
}
}
};
var results = openidm.query("system/ScriptedSQL/account", params)
OpenIDM supports nine query filters and a range of keywords that can be applied to these filters. Each filter takes a field and a list as value. The following filters are supported:
Attribute Operations
EqualsFilter-
Determines whether the resource contains an attribute that matches a specific attribute value.
Returns
trueif the object satisfies all selection criteria of the filter, otherwise returnsfalse.For example:
{ "Equals":{ "field":"lastname", "values":[ "Doe" ] } } ContainsAllValuesFilter-
Determines whether the external resource contains an attribute that has the same name as, and contains all of the values of, the attribute placed into the filter.
Returns
trueif the object satisfies all the selection criteria of the filter, otherwise returnsfalse.
Comparable Attribute Operations
Compares single-value attributes to a given filter.
GreaterThanFilter-
Determines whether the attribute value of the resource object is greater than the one provided in the filter.
Returns
trueif the object value is greater, otherwise returnsfalse. GreaterThanOrEqualFilter-
Determines whether the attribute value of the resource object is greater than or equal to the one provided in the filter.
Returns
trueif the object value is greater than or equal, otherwise returnsfalse. LessThanFilter-
Determines whether the attribute value of the resource object is less than the one provided in the filter.
Returns
trueif the object value is less, otherwise returnsfalse. LessThanOrEqualFilter-
Determines whether the attribute value of the resource object is less than or equal to the one provided in the filter.
Returns
trueif the object value is less than or equal, otherwise returnsfalse.
String Attribute Operations
Compares string values to a given filter.
StartsWithFilter-
Returns attributes whose value starts with the string specified in the filter.
ContainsFilter-
Returns attributes whose value contains the string specified in the filter.
EndsWithFilter-
Returns attributes whose value ends with the string specified in the filter.
Filter Operations
Filter operations are used to construct more complex filters by comparing two filters from the preceding section or negating filters defined in the previous section.
AND Filter-
A filter that matches entries using the AND boolean operator on two filters.
Example:
{ "query":{ "AND":[ { "Equals":{ "field":"lastname", "values":[ "Doe" ] } }, { "Equals":{ "field":"firstname", "values":[ "John" ] } } ] } } OR Filter-
A filter that matches entries using the OR boolean operator on two filters.
Example:
{ "query":{ "OR":[ { "StartsWith":{ "field":"lastname", "values":[ "A" ] } }, { "StartsWith":{ "field":"lastname", "values":[ "B" ] } } ] } } NOT Filter-
A filter that filters out matched entries by negating another filter.
Example:
{ "query":{ "NOT":[ { "Equals":{ "field":"lastname", "values":[ "Doe" ] } } ] } }

