GUBUS FILTER

GUBUS FILTER removes objects from localObjs that do not meet specified filter conditions, supporting 20+ commands and AND logic.

GUBUS FILTER

Overview

FILTER removes objects that don’t meet specified conditions. Objects failing any filter check are excluded from localObjs.

Key characteristics:

  • 20+ filter commands for various checks
  • Multiple filters with same reference allowed = AND logic (all must pass) to be kept in local objs
  • Objects without required field_name automatically fail

How It Works

[For each object in localObjs]
  → Check field_name value against filter_command + field_value
  → If fails: Remove from localObjs
  → If passes: Keep object

All filters with matching reference execute sequentially. Object must pass ALL filters to remain.


Filter Commands

Type Checks

COMMANDPURPOSENeeds field_value
CHECK_IS_STRINGKeep if field is stringNo
CHECK_IS_NUMBERKeep if field is numberNo
CHECK_IS_POSITIVE_NUMBERKeep if field > 0No

Equality Checks

COMMANDPURPOSENeeds field_value
CHECK_EQUALSKeep if field == field_valueYes
CHECK_NOT_EQUALSKeep if field != field_valueYes
CHECK_INKeep if field in “val1,val2,val3”Yes
CHECK_NOT_INKeep if field NOT in listYes

Presence Checks

COMMANDPURPOSENeeds field_value
CHECK_IS_PRESENTKeep if field exists and not emptyNo
CHECK_NOT_PRESENTKeep if field missing or emptyNo
CHECK_NOT_PRESENT_OR_FALSYKeep if missing/empty/null/falseNo

String Checks

COMMANDPURPOSENeeds field_value
CHECK_STARTS_WITHKeep if field starts with valueYes
CHECK_HAS_STRICT_LENGTHKeep if field.length == valueYes

Special Checks

COMMANDPURPOSENeeds field_value
CHECK_NOT_GOOGLE_MISTAKEExclude #DIV/0!, #VALUE!, #REF!, #NAME?, #N/A, #NUM!No
CHECK_IS_TRUEKeep if field === trueNo

Rule Properties

PROPERTYDESCRIPTION
referenceLinks filter rules. All with same reference execute together
field_nameField to check. Example: “status”
filter_commandCommand from table above
field_valueValue for comparison (required for most commands)
stop_here_if_trueBoolean. Skip remaining filters if this passes
messageCustom message for logging

Use Cases

Filter Completed Orders

{
  "reference": "getCompleted",
  "field_name": "status",
  "filter_command": "CHECK_EQUALS",
  "field_value": "completed"
}

Input: [{status: "completed"}, {status: "pending"}, {status: "completed"}] Output: Only objects with status: "completed"


Clean Google Errors + Validate Type

[
  {"reference": "clean", "field_name": "qty", "filter_command": "CHECK_NOT_GOOGLE_MISTAKE"},
  {"reference": "clean", "field_name": "qty", "filter_command": "CHECK_IS_POSITIVE_NUMBER"}
]

Input: [{qty: 10}, {qty: "#DIV/0!"}, {qty: -5}, {qty: 20}] Output: [{qty: 10}, {qty: 20}]

Both filters must pass (AND logic).


Multi-Value Match

{
  "field_name": "status",
  "filter_command": "CHECK_IN",
  "field_value": "completed,shipped,delivered"
}

Keeps objects where status is ANY of the listed values.


Troubleshooting

All objects removed: Verify field_name exists, check filter_command logic, test with single filter.

Not filtering: Check reference matches schema config, verify filter_command spelling, ensure field_value type matches field type.

Unexpected AND results: Remember same reference = ALL must pass.

Use gubus_debug: to see obj state before/after filters.


Summary

FILTER removes objects not meeting conditions:

  • 20+ commands for type/equality/presence/string checks
  • AND logic for multiple filters (same reference)
  • Failed objects permanently removed

When to use: Relevant data for particular schema filtering, subset extraction, error exclusion