Used in the filter parameter of APIs like find, findOne, findAndCount, count of a Repository:
To support JSON serialization, NocoBase identifies query operators with a string prefixed with $.
Additionally, NocoBase provides an API to extend operators, see db.registerOperators() for details.
$eqChecks if the field value is equal to the specified value. Equivalent to SQL's =.
Example
Equivalent to title: 'The Great Gatsby'.
$neChecks if the field value is not equal to the specified value. Equivalent to SQL's !=.
Example
$isChecks if the field value is the specified value. Equivalent to SQL's IS.
Example
$notChecks if the field value is not the specified value. Equivalent to SQL's IS NOT.
Example
$colChecks if the field value is equal to the value of another field. Equivalent to SQL's =.
Example
$inChecks if the field value is in the specified array. Equivalent to SQL's IN.
Example
$notInChecks if the field value is not in the specified array. Equivalent to SQL's NOT IN.
Example
$emptyChecks if a general field is empty. For a string field, it checks for an empty string. For an array field, it checks for an empty array.
Example
$notEmptyChecks if a general field is not empty. For a string field, it checks for a non-empty string. For an array field, it checks for a non-empty array.
Example
$andLogical AND. Equivalent to SQL's AND.
Example
$orLogical OR. Equivalent to SQL's OR.
Example
For boolean fields type: 'boolean'
$isFalsyChecks if a boolean field value is falsy. Field values of false, 0, and NULL are all considered $isFalsy: true.
Example
$isTrulyChecks if a boolean field value is truly. Field values of true and 1 are all considered $isTruly: true.
Example
For numeric fields, including:
type: 'integer'type: 'float'type: 'double'type: 'real'type: 'decimal'$gtChecks if the field value is greater than the specified value. Equivalent to SQL's >.
Example
$gteChecks if the field value is greater than or equal to the specified value. Equivalent to SQL's >=.
Example
$ltChecks if the field value is less than the specified value. Equivalent to SQL's <.
Example
$lteChecks if the field value is less than or equal to the specified value. Equivalent to SQL's <=.
Example
$betweenChecks if the field value is between the two specified values. Equivalent to SQL's BETWEEN.
Example
$notBetweenChecks if the field value is not between the two specified values. Equivalent to SQL's NOT BETWEEN.
Example
For string fields, including string
$includesChecks if the string field contains the specified substring.
Example
$notIncludesChecks if the string field does not contain the specified substring.
Example
$startsWithChecks if the string field starts with the specified substring.
Example
$notStatsWithChecks if the string field does not start with the specified substring.
Example
$endsWithChecks if the string field ends with the specified substring.
Example
$notEndsWithChecks if the string field does not end with the specified substring.
Example
$likeChecks if the field value contains the specified string. Equivalent to SQL's LIKE.
Example
$notLikeChecks if the field value does not contain the specified string. Equivalent to SQL's NOT LIKE.
Example
$iLikeChecks if the field value contains the specified string, case-insensitive. Equivalent to SQL's ILIKE (PostgreSQL only).
Example
$notILikeChecks if the field value does not contain the specified string, case-insensitive. Equivalent to SQL's NOT ILIKE (PostgreSQL only).
Example
$regexpChecks if the field value matches the specified regular expression. Equivalent to SQL's REGEXP (PostgreSQL only).
Example
$notRegexpChecks if the field value does not match the specified regular expression. Equivalent to SQL's NOT REGEXP (PostgreSQL only).
Example
$iRegexpChecks if the field value matches the specified regular expression, case-insensitive. Equivalent to SQL's ~* (PostgreSQL only).
Example
$notIRegexpChecks if the field value does not match the specified regular expression, case-insensitive. Equivalent to SQL's !~* (PostgreSQL only).
Example
For date fields type: 'date'
$dateOnChecks if the date field is on a specific day.
Example
$dateNotOnChecks if the date field is not on a specific day.
Example
$dateBeforeChecks if the date field is before a specific value. Equivalent to being less than the provided date value.
Example
$dateNotBeforeChecks if the date field is not before a specific value. Equivalent to being greater than or equal to the provided date value.
Example
$dateAfterChecks if the date field is after a specific value. Equivalent to being greater than the provided date value.
Example
$dateNotAfterChecks if the date field is not after a specific value. Equivalent to being less than or equal to the provided date value.
Example
For array fields type: 'array'
$matchChecks if the array field's value matches the values in the specified array.
Example
$notMatchChecks if the array field's value does not match the values in the specified array.
Example
$anyOfChecks if the array field's value contains any of the values in the specified array.
Example
$noneOfChecks if the array field's value contains none of the values in the specified array.
Example
$arrayEmptyChecks if the array field is empty.
Example
$arrayNotEmptyChecks if the array field is not empty.
Example
Used to check if an association exists. Field types include:
type: 'hasOne'type: 'hasMany'type: 'belongsTo'type: 'belongsToMany'$existsAssociation data exists
Example
$notExistsNo association data exists
Example