In the respective helper method that streams uploaded data tables (CSV) enable the conversion of string "NULL" or "null" values to natural (true) Javascript null values.
This enables the user to actually leave some attributes empty.
Consider something like the following pseudo-code that can be used to post-process the objects that are going to be passed to the respective create function.
/**
* Function replaces all String values "NULL" or "null" in the argument plain
* old JavaScript object (POJO) with literal null.
*
* @param {Object} pojo - A plain old JavaScript object.
*
* @return {Object} A modified clone of the argument pojo in which all String
* "NULL" or "null" values are replaced with literal nulls.
*/
exports.replacePojoNullValueWithLiteralNull = function(pojo) {
if (pojo === null) {
return null
}
let res = Object.assign({}, pojo)
Object.keys(res).forEach((k) => {
if (res[k] === 'NULL' || res[k] === 'null') {
res[k] = null
}
})
return res
}
In the respective helper method that streams uploaded data tables (CSV) enable the conversion of string
"NULL"
or"null"
values to natural (true) Javascriptnull
values.This enables the user to actually leave some attributes empty.
Consider something like the following pseudo-code that can be used to post-process the objects that are going to be passed to the respective
create
function.Please include integration tests.
Expected work time: 4h