Open matcho opened 2 years ago
Hello,
Is there a standard way to properly filter on empty (or non-empty) string ?
someproperty eq '' fails with
someproperty eq ''
{ "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
someproperty eq ""
{ "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:
someproperty lt ' '
length(someproperty) eq 0
Thanks for any advice.
Greetings, Mathias
Hello,
Is there a standard way to properly filter on empty (or non-empty) string ?
someproperty eq ''
fails withLikewise,
someproperty eq ""
fails withCurrently the workarounds I found are:
someproperty lt ' '
length(someproperty) eq 0
, based on your advice for #109Thanks for any advice.
Greetings, Mathias