[SOLVED] Filter containing a question mark results in MONGO_COMMAND error

I have…

I’m submitting a…

  • [ ] Regression (a behavior that stopped working in a new release)
  • [x] Bug report
  • [ ] Performance issue
  • [ ] Documentation issue or request

Current behavior

When making the following query:

query {
  queryTeamsContentsWithTotal(top: 8, skip: 0, filter: "contains(data/displayName/iv, '%3F')", orderby: "data/displayName/iv") { 
    total
    items {
      data {
        displayName {
          iv
        }
      }
    }
  }
}

We get the following response from squidex:

{
  "errors": [
    {
      "message": "Error trying to resolve field 'queryTeamsContentsWithTotal'.",
      "locations": [
        {
          "line": 2,
          "column": 3
        }
      ],
      "path": [
        "queryTeamsContentsWithTotal"
      ],
      "extensions": {
        "code": "MONGO_COMMAND",
        "codes": [
          "MONGO_COMMAND"
        ]
      }
    }
  ],
  "data": {
    "queryTeamsContentsWithTotal": null
  }
}

Expected behavior

It should return the results as normal, since ‘%3F’ is a hex encoded question mark

Minimal reproduction of the problem

See above

Environment

  • [ ] Self hosted with docker
  • [ ] Self hosted with IIS
  • [ ] Self hosted with other version
  • [x] Cloud version

Version: [VERSION]

Browser:

  • [x] Chrome (desktop)
  • [ ] Chrome (Android)
  • [ ] Chrome (iOS)
  • [ ] Firefox
  • [ ] Safari (desktop)
  • [ ] Safari (iOS)
  • [ ] IE
  • [ ] Edge

Others:

1 Like

FYI - same applies to ‘%29’ which is ‘(’

Thank you. The problem is that the contains is interpreted as regex. I guess I have to make a conversion or so first.

1 Like

Alright, cool. Please keep me updated on the progress of the fix as this is affecting our production systems.

thanks

This topic was automatically closed after 2 days. New replies are no longer allowed.