Skip to content

Commit

Permalink
array_type_field_filter: Adds contains filter
Browse files Browse the repository at this point in the history
1. Adds new filter for array type field.
2. From this filter you can search from array type field.

Signed-off-by: shubhisood <shubhi.sood@sourcefuse.com>
  • Loading branch information
shubhisood committed Sep 5, 2020
1 parent 261dd1c commit 982f97e
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/model-utils.js
Expand Up @@ -88,6 +88,7 @@ const operators = {
ilike: 'ILIKE',
nilike: 'NOT ILIKE',
regexp: 'REGEXP',
contains: '@>',
};

/*
Expand Down Expand Up @@ -449,6 +450,7 @@ ModelUtils._coerce = function(where, options, modelDef) {
case 'inq':
case 'nin':
case 'between':
case 'contains':
try {
val = coerceArray(val);
} catch (e) {
Expand Down

0 comments on commit 982f97e

Please sign in to comment.