Skip to content

REST API $contains and $containsi filter operators return empty data #25795

@gottfried-github

Description

@gottfried-github

Node Version

24.12.0

Package Manager

npm

Package Manager Version

11.6.2

Strapi Version

5.40.0

Operating System

Docker/Podman/LXC

Database

PostgreSQL

Javascript or Typescript

Javascript

Reproduction URL

https://github.com/gottfried-github/strapi-contains-issue

Bug Description

$contains and $containsi operators in REST API return empty data. With Document Service API, $contains works as expected (see reproduction repo).

I have both Draft & Publish and Internationalzation disabled.

I also tried to run REST API queries with SQLite and got the same result.

I also tried to run the following query using $eq operator, which does work:

curl -g localhost:1337/api/performances?filters[title][$eq]=test02

Steps to Reproduce

  1. import data from the backup in the reproduction repo (it contains 2 documents with the following title: test01, test02)
  2. run the queries curl -g localhost:1337/api/performances?filters[title][$contains]=est02, curl -g localhost:1337/api/performances?filters[title][$containsi]=est02
  3. observe that empty data array is returned

Expected Behavior

Should return a single document with title of test02

Logs

Code Snippets

No response

Media

No response

Additional information

No response

Confirmation Checklist

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions