Skip to content

feat: add support for jsonContains operator on array fields - #923

Open
aaqilniz wants to merge 1 commit into
loopbackio:masterfrom
aaqilniz:feat/support-jsoncontains
Open

aaqilniz wants to merge 1 commit into
loopbackio:masterfrom
aaqilniz:feat/support-jsoncontains

Conversation

@aaqilniz

@aaqilniz aaqilniz commented Nov 1, 2026

Copy link
Copy Markdown
Contributor
  • Implements the jsonContains operator mapping inside PostgreSQL's buildExpression to support array/containment queries (such as those required for referencesMany relations).
  • Automatically parses and normalizes stringified JSON or single values into an array, generating PostgreSQL-native containment checks (col @> CAST(? AS JSONB)) connected with OR.
  • Adds comprehensive unit and integration tests covering record filtering and raw SQL string/parameter generation for JSONB fields.

Checklist

  • DCO (Developer Certificate of Origin) signed in all commits
  • npm test passes on your machine
  • New tests added or existing tests modified to cover all changes
  • Code conforms with the style guide
  • Commit messages are following our guidelines

Signed-off-by: Muhammad Aaqil <aaqilcs102@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant