Comments (4)
Use this (recently added and not yet documented) syntax:
"abc": "{<code>}"
This means: replace with the value in the code property of the data source object if it exists. If the code property doesn't exist in the data source object, remove the abc property from the result object
from qewd-transform-json.
Another trick is within a function transform, return this to delete the result object:
"<!delete>"
from qewd-transform-json.
"abc": "{<code>}"
.
This feature did what was required.
Documenting for a better view
Instead of
"phone": "{{phone}}"
.
This would create an empty phone node if the phone is null or not found in the original document to transform.
Do
"phone": "{<phone>}"
from qewd-transform-json.
This needs to have another enhancement.
what is needed is a hybrid solution.
Lets assume there are two fields in the incoming data
given_name
family_name
The mapping changes given_name to firstName and family_name to lastName.
If we do
firstName: "{<given_name>}"
lastName: "{<family_name>}"
If the given_name is empty or null the map won't copy. The issue here is if we do change first_name once with a non null value and then if we want to remove this. The map would not allow the null value to be entered.
So this feature needs to be enhanced to the following
if a field is found in the input then the map should take it. If the field does have a null value then the map should put back the null value.
E.g
"given_name": "Mary"
next we give
"given_name": null
Here the expectation is the mapping should give "firstName": null. Currently it's removing this field as it treats a field with null value and a field not present as same.
if only data has only that field
"family_name": "Jane"
The mapping should only give
"lastName" : "Jane". Here it can removing firstName field correctly.
from qewd-transform-json.
Related Issues (10)
- Change instruction on npmjs.com HOT 1
- Add a transform method for async HOT 2
- Support for non quoted maps like boolean and number HOT 1
- Update documentation for String.format capabilities HOT 3
- Get parent DATA from array element HOT 1
- Web version
- Cannot read property 'init' of undefined HOT 2
- Object path issue in transform.js
- Issue parsing array with multiple values
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 qewd-transform-json.