queryExist method

Future<List<Result>> queryExist({
  1. required String where,
  2. required String what,
})

Searches for what existing in the where column when exists.

Like all other query functions:

  • When where is not specified, it's a global search in every column of the elements
  • When specificNormalization is specified, it is used instead of the global normalization settings. However, the global normalization settings are still used as fallback when specificNormalization does not provide a setting.

Returns its research findings.

Implementation

Future<List<Result>> queryExist({
  required String where,
  required String what,
}) async {
  return _anyQuery(where, (element, columnId, priority, refResults) {
    // Gets the value from the currently "studied" column of the element.
    final value = element[columnId];

    // Does not exist or the value exists but it is null.
    if (value == null || value[what] == null) {
      return;
    }

    // The result is matching, adds it.
    _addResultChecked(refDestination: refResults, element: element, priority: priority);
  });
}