Comparison Operators

JFrog REST APIs

Content Type
REST API

Note

Using comparison operators, such as `$match`, as the sole criteria in an AQL query can sometimes yield unexpected or overly broad results.

This is especially evident when searching for fields that correspond to underlying database entities, such as the `repo` field, particularly for layered package types like Docker images.

For example, a query that only uses `$match` for a repository pattern: `items.find( {"repo" :{"$match":"bzwbk-docker-"}} )`

This query might generate an overly generic SQL query on the Artifactory backend, causing the results to include internal artifacts (like Docker layers) that are associated with the repository but do not explicitly match the user-provided `repo` pattern.

To ensure your AQL query targets only the intended artifacts and produces accurate results, you must combine comparison operators with other specific criteria (e.g., `type`, `path`, or `name`) that help narrow the backend search scope.

The following table lists the full set of comparison operators.

Operator

Types

Meaning

$ne

string, date, int, long

Not equal to

$eq

string, date, int, long

Equals

$gt

string, date, int, long

Greater than

$gte

string, date, int, long

Greater than or equal to

$lt

string, date, int, long

Less than

$lte

string, date, int, long

Less than or equal to

$match

string

Matches

$nmatch

string

Does not match

For time-based operations, please also refer to Relative Time Operators.