Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Filter on empty string #133

Open
matcho opened this issue Nov 8, 2021 · 0 comments
Open

Filter on empty string #133

matcho opened this issue Nov 8, 2021 · 0 comments

Comments

@matcho
Copy link

matcho commented Nov 8, 2021

Hello,

Is there a standard way to properly filter on empty (or non-empty) string ?

someproperty eq '' fails with

{
  "code": 400,
  "type": "error",
  "message": "Query is not valid: Encountered \" \"\\'\\'\" \"\\'\\' \"\" at line 1, column 94.\nWas expecting one of:\n    \"(\" ...\n    <LONG> ...\n    <DOUBLE> ...\n    <DATETIMEINTERVAL> ...\n    <DATETIME> ...\n    <DATE> ...\n    <TIME> ...\n    <DURATION> ...\n    \"eq\" ...\n    \"ne\" ...\n    \"gt\" ...\n    \"ge\" ...\n    \"lt\" ...\n    \"le\" ...\n    \"and\" ...\n    \"or\" ...\n    \"add\" ...\n    \"sub\" ...\n    \"mul\" ...\n    \"div\" ...\n    \"mod\" ...\n    \"expand\" ...\n    \"orderby\" ...\n    \"asc\" ...\n    \"desc\" ...\n    \"top\" ...\n    \"count\" ...\n    \"skip\" ...\n    \"select\" ...\n    \"filter\" ...\n    <QF_LENGTH> ...\n    <QF_INDEXOF> ...\n    <QF_SUBSTRING> ...\n    <QF_TOLOWER> ...\n    <QF_TOUPPER> ...\n    <QF_TRIM> ...\n    <QF_CONCAT> ...\n    <QF_YEAR> ...\n    <QF_MONTH> ...\n    <QF_DAY> ...\n    <QF_HOUR> ...\n    <QF_MINUTE> ...\n    <QF_SECOND> ...\n    <QF_FRACTIONALSECONDS> ...\n    <QF_DATE> ...\n    <QF_TIME> ...\n    <QF_TOTALOFFSETMINUTES> ...\n    <QF_NOW> ...\n    <QF_MINDATETIME> ...\n    <QF_MAXDATETIME> ...\n    <QF_ROUND> ...\n    <QF_FLOOR> ...\n    <QF_CEILING> ...\n    <QF_GEO_DISTANCE> ...\n    <QF_GEO_LENGTH> ...\n    \"true\" ...\n    \"false\" ...\n    <CHARSEQ> ...\n    <GEO_STR_LIT> ...\n    <STR_LIT> ...\n    "
}

Likewise, someproperty eq "" fails with

{
  "code": 400,
  "type": "error",
  "message": "Query is not valid: Lexical error at line 1, column 94.  Encountered: \"\\\"\"(34),
  after: \"\""
}

Currently the workarounds I found are:

Thanks for any advice.

Greetings,
Mathias

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

No branches or pull requests

1 participant