metafacture / metafacture-fix

Work in progress towards an implementation of the Fix language for Metafacture
Apache License 2.0
6 stars 2 forks source link

`copy_field` element multiple times into array. `replace_all` works only once on target path. #250

Open TobiasNx opened 1 year ago

TobiasNx commented 1 year ago

in:

{
    "number" : "1234"
}

FIX:

set_array("identifier[]")
copy_field("number", "identifier[].$append.id")
copy_field("number", "identifier[].$append.id")
replace_all("identifier[].*.id","2","?")

out:

{
  "number" : "1234",
  "identifier" : [ {
    "id" : "1234"
  }, {
    "id" : "1?34"
  } ]
}

expected:

{
  "number" : "1234",
  "identifier" : [ {
    "id" : "1?34"
  }, {
    "id" : "1?34"
  } ]
}

see here in playground.

blackwinter commented 1 year ago

See also hbz/lobid-resources#1375.