Comments (1)
It is working in the below code. Please have a look. The expression starts with $, but it doesn't mean that you should use self without $ sing.
wrong expression: $self.data.provider == 'TEXAS' || $ self.data.provider == 'VODAFONE'
correct expression:
$self.data.provider == 'TEXAS' || self.data.provider == 'VODAFONE'
public class Main {
public static void main(String[] args) {
var input = """
[
{
"provider": "VODAFONE"
},
{
"provider": "VERIZON"
},
{
"provider": "TEXAS"
}
]
""";
var mapping = """
result:
path: /
type: array
filter: $self.data.provider == 'TEXAS' or self.data.provider == 'VODAFONE'
fields:
provider:
""";
var dsm = new DSMBuilder(mapping).setType(DSMBuilder.TYPE.JSON).create();
var result = dsm.toObject(input);
System.out.println(result);
}
}
Result:
[{provider=VODAFONE}, {provider=TEXAS}]
from dsm.
Related Issues (19)
- java.lang.IllegalArgumentException: URI is not hierarchical HOT 2
- How to parse XML if format in below manner? HOT 7
- java.lang.IllegalArgumentException: URI is not hierarchical at java.io.File.<init>(File.java:418) HOT 12
- Working with DSM in my project HOT 3
- Handling arrays of arrays HOT 3
- It's a great project, HOT 1
- The conversion seems a little problematic when the root node is an array HOT 2
- Can field maps support wildcards
- Can we support object to string and string to object
- The conversion function is executed correctly only if path is set for the field. Is this necessary HOT 1
- help to check XML node HOT 1
- One more duplicate data exists when converting json array HOT 2
- new count type
- setParams function not work as expected
- bigDecimal dataTYpe not working
- parsing element is not merged when path is null
- dynamic fieldName
- dynamic filter - clarification - Urgent HOT 4
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 dsm.