whereEndsWith method

void whereEndsWith(
  1. String column,
  2. String prefix, {
  3. bool caseSensitive = false,
})

Add a constraint for finding objects where the String value in column ends with prefix

Implementation

void whereEndsWith(
  String column,
  String prefix, {
  bool caseSensitive = false,
}) {
  prefix = Uri.encodeComponent(prefix);

  if (caseSensitive) {
    queries.add(MapEntry<String, dynamic>(
        _singleQuery, '"$column":{"\$regex": "$prefix\$"}'));
  } else {
    queries.add(MapEntry<String, dynamic>(_singleQuery,
        '"$column":{"\$regex": "$prefix\$", "\$options": "i"}'));
  }
}