getSituationIds
A MoogDb v2 method that returns the total number of Situations, and a list of their Situation IDs, for a Situation filter and a limit.
Back to MoogDb V2 API Method Reference.
Request arguments
Method getSituationIds takes the following request arguments:
Name | Type | Required | Description |
|---|---|---|---|
| JSON Object | Yes | An SQL-like filter that Situations must match to be returned. See Filter Search Data for more information on creating SQL-like filters. |
| Number | Maximum number of Situation IDs to return. |
Response
Method getSituationIds returns the following response:
Type | Description |
|---|---|
Native Object | A JSON object containing the total and the Situation IDs. |
Examples
The following examples demonstrate typical use of method getSituationIds:
Request example
Example request to return the first 10 Situation IDs where the Internal Priority is 5 and the description matches "Link is Down":
var target_sigs = moogdb.getSituationIds("Internal_Priority IN \(5\) AND \(Description MATCHES \"Link is Down\"\)",10);
logger.warning("moogdb.getSituationIds result - total_situations = " + target_sigs.total_situations + " and sitn_ids = " + target_sigs.sitn_ids);Response example
Example response returning the total number of Situations and the Situation IDs matching the filter:
{
"total_situations":10,
"sitn_ids":[4, 5, 6, 12, 14, 15, 16, 17, 18, 19]
}