Comments (4)
You could turn indexof(tolower(Name), 'gead')
into a string like so:
{
filter: {
Item: {
any: {
"indexof(tolower(i/Name), 'gead')": {
eq: -1
}
}
}
}
}
You can past that into this sandbox and see the output:
"?$filter=Item/any(i:indexof(i/tolower(i/Name), 'gead') eq -1)"
although I just noticed it added i/tolower
and not just tolower
. This might be due to how that sandbox is written to JSON.parse
the input values. Give it a try in your code and let me know.
If you need to interpolate the 'gead'
value, you should be able to like so:
{
filter: {
Item: {
any: {
`indexof(tolower(i/Name), ${someVal})`: {
eq: -1
}
}
}
}
}
from odata-query.
I'm using it as a string, I must've not formatted the original post correctly.
Taking your suggestion with adding the variable manually it ends up not respecting that variable.
filter=((PROJECT/any(p:indexof(p/tolower(p/Name), 'te') eq -1)))
It seems to do the same as what the sandbox is doing.
from odata-query.
Hmm, just took a quick look, and it appears we prefix any parameters within a function using this regex, which is why p/tolower
is being prefixed from the nested functions.
I'm not sure of a clean solution at this point, and have moved away from OData for my current projects to GraphQL so don't have a direct need. If you can find a solution that doesn't break the other use cases, I'm happy to review a PR and merge/release.
from odata-query.
Hmm ok, I'll ponder this too and get back.
from odata-query.
Related Issues (20)
- Double filters in querystring HOT 3
- Automatically Title-Case Camel-Cased props HOT 1
- Filter with Any clause bad conversion
- ESM default export is not properly defined
- Add $skip support to $expand ExpandOptions
- TS error on $select when $orderBy added HOT 1
- not requires a whitespace
- [Question] Is the project maintained? HOT 4
- Select within an expand on an optional property not compatible with keyof
- Support compute query option HOT 7
- Support for an equality filter comparing two properties
- option to add custom query params HOT 1
- New Version Published? HOT 1
- adding whitespace after contains
- Parse query-string back into queryOptions-object HOT 2
- Add raw's description in documentation HOT 1
- Support for custom operator HOT 1
- Handling Typed Property Name Filter
- Issue with not operator inside collection filter
- $apply GroupBy Transform not capable of producing the query needed
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from odata-query.