-
Notifications
You must be signed in to change notification settings - Fork 0
Fields present
natlibfi-arlehiko edited this page Jun 10, 2019
·
3 revisions
Check whether the configured fields are present in the record.
An array of field tag patterns
[/^008$/, /^245$/]
Config
[/^1..$/, /^FOO$/]
Valid record
{
"fields": [
{
"tag": "001",
"value": "123456"
},
{
"tag": "110",
"subfields": [
{
"code": "a",
"value": "foobar"
}
]
},
{
"tag": "FOO",
"subfields": [
{
"code": "a",
"value": "foo"
}
]
}
]
}
Invalid record
{
"fields": [
{
"tag": "001",
"value": "123456"
},
{
"tag": "101",
"subfields": [
{
"code": "a",
"value": "foobar"
}
]
},
{
"tag": "BAR",
"subfields": [
{
"code": "a",
"value": "foo"
}
]
}
]
}
Config
[/^50.$/]
Valid record
{
"fields": [
{
"tag": "001",
"value": "123456"
},
{
"tag": "500",
"subfields": [
{
"code": "a",
"value": "foo"
}
]
},
{
"tag": "550",
"subfields": [
{
"code": "a",
"value": "bar"
}
]
}
]
}
Invalid record
{
"fields": [
{
"tag": "001",
"value": "123456"
},
{
"tag": "510",
"subfields": [
{
"code": "a",
"value": "foo"
}
]
},
{
"tag": "550",
"subfields": [
{
"code": "a",
"value": "bar"
}
]
}
]
}
Config
[/^(020|022|024)$/]
Valid record
{
"fields": [
{
"tag": "001",
"value": "123456"
},
{
"tag": "020",
"subfields": [
{
"code": "a",
"value": "978-3-16-148410-0"
}
]
},
{
"tag": "550",
"subfields": [
{
"code": "a",
"value": "bar"
}
]
}
]
}
Invalid record
{
"fields": [
{
"tag": "001",
"value": "123456"
},
{
"tag": "550",
"subfields": [
{
"code": "a",
"value": "bar"
}
]
}
]
}